Skip to content

Commit

Permalink
Merge pull request #277 from atsign-foundation/feat/connectivity_checker
Browse files Browse the repository at this point in the history
feat: internet connection check
  • Loading branch information
sachins-geekyants authored Apr 19, 2023
2 parents 39e3c06 + c886bd5 commit 74917d5
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 74917d5

Please sign in to comment.