From 226417aa491efb21dd1aa04435070cb567224e10 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:02:57 +0530 Subject: [PATCH] show snackbar instead of dialog for openglass support --- .../pages/onboarding/find_device/found_devices.dart | 12 ------------ app/lib/providers/onboarding_provider.dart | 5 ++++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/app/lib/pages/onboarding/find_device/found_devices.dart b/app/lib/pages/onboarding/find_device/found_devices.dart index 8981c8910..582c06bad 100644 --- a/app/lib/pages/onboarding/find_device/found_devices.dart +++ b/app/lib/pages/onboarding/find_device/found_devices.dart @@ -46,18 +46,6 @@ class _FoundDevicesState extends State { // (route) => false, // ); Navigator.pop(context); - } else if (info == 'OPENGLASS_NOT_SUPPORTED') { - showDialog( - context: context, - builder: (context) { - return getDialog(context, () { - Navigator.pop(context); - }, () { - Navigator.pop(context); - }, "OpenGlass isn't supported", - "OpenGlass isn’t available in this version of the app. It will be added in a future update once it's ready", - singleButton: true); - }); } else { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text(info), diff --git a/app/lib/providers/onboarding_provider.dart b/app/lib/providers/onboarding_provider.dart index 5ef92470e..8bbd66400 100644 --- a/app/lib/providers/onboarding_provider.dart +++ b/app/lib/providers/onboarding_provider.dart @@ -14,6 +14,7 @@ import 'package:friend_private/providers/device_provider.dart'; import 'package:friend_private/services/devices.dart'; import 'package:friend_private/services/notifications.dart'; import 'package:friend_private/services/services.dart'; +import 'package:friend_private/utils/alerts/app_snackbar.dart'; import 'package:friend_private/utils/analytics/analytics_manager.dart'; import 'package:friend_private/utils/audio/foreground.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -148,7 +149,9 @@ class OnboardingProvider extends BaseProvider with MessageNotifierMixin implemen VoidCallback? goNext, }) async { if (device.name.toLowerCase() == 'openglass' || device.type == DeviceType.openglass) { - notifyInfo('OPENGLASS_NOT_SUPPORTED'); + // notifyInfo('OPENGLASS_NOT_SUPPORTED'); + AppSnackbar.showSnackbarError( + 'OpenGlass is not supported at the moment. Support will be added in a future update'); return; } try {