Skip to content

Commit

Permalink
imp: add more checks for error message
Browse files Browse the repository at this point in the history
  • Loading branch information
juliansteenbakker committed Sep 29, 2023
1 parent c0ba560 commit c52b3c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.2.1"
version: "4.2.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
16 changes: 14 additions & 2 deletions lib/src/widgets/cards/login_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,13 @@ class _LoginCardState extends State<_LoginCard> with TickerProviderStateMixin {

if (!DartHelper.isNullOrEmpty(error)) {
await control?.reverse();
showErrorToast(context, messages.flushbarTitleError, error!);

// Only show error toast if error is not in exclusion list
if (loginProvider.errorsToExcludeFromErrorMessage == null ||
!loginProvider.errorsToExcludeFromErrorMessage!.contains(error)) {
showErrorToast(context, messages.flushbarTitleError, error!);
}

Future.delayed(const Duration(milliseconds: 271), () {
if (mounted) {
setState(() => _showShadow = true);
Expand All @@ -326,7 +332,13 @@ class _LoginCardState extends State<_LoginCard> with TickerProviderStateMixin {
);
await control?.reverse();
if (!DartHelper.isNullOrEmpty(error)) {
showErrorToast(context, messages.flushbarTitleError, error!);

// Only show error toast if error is not in exclusion list
if (loginProvider.errorsToExcludeFromErrorMessage == null ||
!loginProvider.errorsToExcludeFromErrorMessage!.contains(error)) {
showErrorToast(context, messages.flushbarTitleError, error!);
}

Future.delayed(const Duration(milliseconds: 271), () {
if (mounted) {
setState(() => _showShadow = true);
Expand Down

0 comments on commit c52b3c2

Please sign in to comment.