From c52b3c2f65bb79ac18a769f282c9dd909ae000dd Mon Sep 17 00:00:00 2001 From: jst Date: Fri, 29 Sep 2023 11:32:41 +0200 Subject: [PATCH] imp: add more checks for error message --- example/pubspec.lock | 2 +- lib/src/widgets/cards/login_card.dart | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index 5450218b..967915c7 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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 diff --git a/lib/src/widgets/cards/login_card.dart b/lib/src/widgets/cards/login_card.dart index 911dfc0e..2e6de6b9 100644 --- a/lib/src/widgets/cards/login_card.dart +++ b/lib/src/widgets/cards/login_card.dart @@ -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); @@ -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);