Skip to content

Commit

Permalink
feat: added internet connection check on onboarding fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Sardar1208 committed Apr 12, 2023
1 parent 39e3c06 commit c886bd5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/services/backend_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,14 @@ class BackendService {
value, result.atsign!, atClientPrefernce);
break;
case AtOnboardingResultStatus.error:
var isConnected = Provider.of<InternetConnectivityChecker>(
NavService.navKey.currentContext!,
listen: false)
.isInternetAvailable;

SnackbarService().showSnackbar(
NavService.navKey.currentContext!,
(result.message ?? '').isNotEmpty ? '' : 'Onboarding failed.',
isConnected ? "Onboarding failed" : "No internet available",
bgColor: ColorConstants.redAlert,
);
break;
Expand Down

0 comments on commit c886bd5

Please sign in to comment.