diff --git a/lib/features/base/base_controller.dart b/lib/features/base/base_controller.dart index 15c0166f1..289a63a3f 100644 --- a/lib/features/base/base_controller.dart +++ b/lib/features/base/base_controller.dart @@ -197,17 +197,7 @@ abstract class BaseController extends GetxController void handleUrgentExceptionOnWeb({Failure? failure, Exception? exception}) { logError('$runtimeType::handleUrgentExceptionOnWeb():Failure: $failure | Exception: $exception'); if (exception is NoNetworkError) { - if (currentOverlayContext != null && currentContext != null) { - appToast.showToastMessage( - currentOverlayContext!, - AppLocalizations.of(currentContext!).no_internet_connection, - actionName: AppLocalizations.of(currentContext!).skip, - onActionClick: ToastView.dismiss, - leadingSVGIcon: imagePaths.icNotConnection, - backgroundColor: AppColor.textFieldErrorBorderColor, - textColor: Colors.white, - infinityToast: true,); - } + _handleNotNetworkErrorException(); } else if (exception is ConnectionError) { _handleConnectionErrorException(); } else if (exception is BadCredentialsException) { @@ -228,6 +218,20 @@ abstract class BaseController extends GetxController } } + void _handleNotNetworkErrorException() { + if (currentOverlayContext != null && currentContext != null) { + appToast.showToastMessage( + currentOverlayContext!, + AppLocalizations.of(currentContext!).no_internet_connection, + actionName: AppLocalizations.of(currentContext!).skip, + onActionClick: ToastView.dismiss, + leadingSVGIcon: imagePaths.icNotConnection, + backgroundColor: AppColor.textFieldErrorBorderColor, + textColor: Colors.white, + infinityToast: true); + } + } + void handleFailureViewState(Failure failure) async { logError('$runtimeType::handleFailureViewState():Failure = $failure'); if (failure is LogoutOidcFailure) {