diff --git a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart index 4e74c2089..33a10bd2e 100644 --- a/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart +++ b/lib/features/manage_account/presentation/manage_account_dashboard_controller.dart @@ -2,6 +2,7 @@ import 'package:back_button_interceptor/back_button_interceptor.dart'; import 'package:core/core.dart'; import 'package:dartz/dartz.dart'; +import 'package:fcm/model/firebase_capability.dart'; import 'package:flutter/material.dart'; import 'package:forward/forward/capability_forward.dart'; import 'package:get/get.dart'; @@ -229,6 +230,14 @@ class ManageAccountDashBoardController extends ReloadableController with UserSet } } + bool get isFcmCapabilitySupported { + if (accountId.value != null && sessionCurrent != null) { + return [FirebaseCapability.fcmIdentifier].isSupported(sessionCurrent!, accountId.value!); + } else { + return false; + } + } + bool get isServerSettingsCapabilitySupported { if (accountId.value != null && sessionCurrent != null) { return [capabilityServerSettings].isSupported(sessionCurrent!, accountId.value!); diff --git a/lib/features/manage_account/presentation/menu/settings/settings_first_level_view.dart b/lib/features/manage_account/presentation/menu/settings/settings_first_level_view.dart index 2af88b465..d7040f0f9 100644 --- a/lib/features/manage_account/presentation/menu/settings/settings_first_level_view.dart +++ b/lib/features/manage_account/presentation/menu/settings/settings_first_level_view.dart @@ -141,20 +141,26 @@ class SettingsFirstLevelView extends GetWidget { AccountMenuItem.languageAndRegion.getIcon(controller.imagePaths), () => controller.selectSettings(AccountMenuItem.languageAndRegion) ), - if (PlatformInfo.isMobile) ...[ - Divider( - color: AppColor.colorDividerHorizontal, - height: 1, - indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils), - endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils) - ), - SettingFirstLevelTileBuilder( - AppLocalizations.of(context).notification, - controller.imagePaths.icNotification, - () => controller.selectSettings(AccountMenuItem.notification), - subtitle: AppLocalizations.of(context).allowsTwakeMailToNotifyYouWhenANewMessageArrivesOnYourPhone, - ) - ], + Obx(() { + if (PlatformInfo.isMobile && controller.manageAccountDashboardController.isFcmCapabilitySupported) { + return Column(children: [ + Divider( + color: AppColor.colorDividerHorizontal, + height: 1, + indent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils), + endIndent: SettingsUtils.getHorizontalPadding(context, controller.responsiveUtils) + ), + SettingFirstLevelTileBuilder( + AppLocalizations.of(context).notification, + controller.imagePaths.icNotification, + () => controller.selectSettings(AccountMenuItem.notification), + subtitle: AppLocalizations.of(context).allowsTwakeMailToNotifyYouWhenANewMessageArrivesOnYourPhone, + ) + ]); + } else { + return const SizedBox.shrink(); + } + }), Obx(() { final accountId = controller .manageAccountDashboardController