diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 51e27019..16ccf1af 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -1597,5 +1597,6 @@ "continueCash": "متابعة الدفع نقدًا", "timeFor": "الوقت", "hmgPolicies": "سياسات مجموعة الحبيب الطبية", - "darkMode": "المظهر الداكن" + "darkMode": "المظهر الداكن", + "featureComingSoonDescription": "هذه الميزة ستتوفر قريباً. نحن نعمل جاهدين لإضافة ميزات أكثر تميزاً إلى التطبيق. انتظرونا لمتابعة التحديثات." } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 1498479f..55ed0dd4 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1589,5 +1589,6 @@ "updatetheinformation": "This will allow to gather the most up to date information from your apple watch", "timeFor": "Time For", "hmgPolicies": "HMG Policies", - "darkMode": "Dark Mode" + "darkMode": "Dark Mode", + "featureComingSoonDescription": "Feature is coming soon. We are actively working to bring more exciting features into the app. Stay tuned for updates." } diff --git a/lib/core/utils/utils.dart b/lib/core/utils/utils.dart index 0d600bd7..ac8c152a 100644 --- a/lib/core/utils/utils.dart +++ b/lib/core/utils/utils.dart @@ -405,6 +405,7 @@ class Utils { static Widget getWarningWidget({ String? loadingText, bool isShowActionButtons = false, + bool showOkButton = false, Widget? bodyWidget, Function? onConfirmTap, Function? onCancelTap, @@ -457,7 +458,26 @@ class Utils { ), ], ) - : SizedBox.shrink(), + : showOkButton? + Row( + children: [ + Expanded( + child: CustomButton( + text: LocaleKeys.ok.tr(), + onPressed: () async { + if (onConfirmTap != null) { + onConfirmTap(); + } + }, + backgroundColor: AppColors.bgGreenColor, + borderColor: AppColors.bgGreenColor, + textColor: Colors.white, + // icon: AppAssets.confirm, + ), + ), + ], + ) + :SizedBox.shrink(), ], ).center; } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 62451a3f..8250ec0f 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1590,5 +1590,6 @@ abstract class LocaleKeys { static const timeFor = 'timeFor'; static const hmgPolicies = 'hmgPolicies'; static const darkMode = 'darkMode'; + static const featureComingSoonDescription = 'featureComingSoonDescription'; } diff --git a/lib/presentation/smartwatches/smartwatch_home_page.dart b/lib/presentation/smartwatches/smartwatch_home_page.dart index 70cab3d9..800ff030 100644 --- a/lib/presentation/smartwatches/smartwatch_home_page.dart +++ b/lib/presentation/smartwatches/smartwatch_home_page.dart @@ -6,6 +6,7 @@ import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/common_models/smart_watch.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; +import 'package:hmg_patient_app_new/extensions/route_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/smartwatch_health_data/health_provider.dart'; @@ -19,6 +20,8 @@ import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:provider/provider.dart'; +import '../../core/utils/utils.dart'; + class SmartwatchHomePage extends StatelessWidget { const SmartwatchHomePage({super.key}); @@ -149,15 +152,16 @@ class SmartwatchHomePage extends StatelessWidget { CustomButton( text: LocaleKeys.select.tr(context: context), onPressed: () { - context.read().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png"); - getIt.get().pushPage(page: SmartwatchInstructionsPage( - smartwatchDetails: SmartwatchDetails(SmartWatchTypes.huawei, - "assets/images/png/smartwatches/Huawei_Watch.png", - AppAssets.bluetooth, - LocaleKeys.huaweihealthapplicationshouldbeinstalledinyourphone.tr(context: context), - LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), - LocaleKeys.huaweiwatchshouldbeconnected.tr(context: context)), - )); + // context.read().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png"); + // getIt.get().pushPage(page: SmartwatchInstructionsPage( + // smartwatchDetails: SmartwatchDetails(SmartWatchTypes.huawei, + // "assets/images/png/smartwatches/Huawei_Watch.png", + // AppAssets.bluetooth, + // LocaleKeys.huaweihealthapplicationshouldbeinstalledinyourphone.tr(context: context), + // LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), + // LocaleKeys.huaweiwatchshouldbeconnected.tr(context: context)), + // )); + showUnavailableDialog(context); }, backgroundColor: AppColors.primaryRedColor.withAlpha(40), borderColor: AppColors.primaryRedColor.withAlpha(0), @@ -182,15 +186,17 @@ class SmartwatchHomePage extends StatelessWidget { CustomButton( text: LocaleKeys.select.tr(context: context), onPressed: () { - context.read().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png"); - getIt.get().pushPage(page: SmartwatchInstructionsPage( - smartwatchDetails: SmartwatchDetails(SmartWatchTypes.whoop, - "assets/images/png/smartwatches/Whoop_Watch.png", - AppAssets.bluetooth, - LocaleKeys.whoophealthapplicationshouldbeinstalledinyourphone.tr(context: context), - LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), - LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)), - )); + + showUnavailableDialog(context); + // context.read().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png"); + // getIt.get().pushPage(page: SmartwatchInstructionsPage( + // smartwatchDetails: SmartwatchDetails(SmartWatchTypes.whoop, + // "assets/images/png/smartwatches/Whoop_Watch.png", + // AppAssets.bluetooth, + // LocaleKeys.whoophealthapplicationshouldbeinstalledinyourphone.tr(context: context), + // LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), + // LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)), + // )); }, backgroundColor: AppColors.primaryRedColor.withAlpha(40), borderColor: AppColors.primaryRedColor.withAlpha(0), @@ -212,4 +218,23 @@ class SmartwatchHomePage extends StatelessWidget { ), ); } + + void showUnavailableDialog(BuildContext context) { + + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.notice.tr(context: context), + context, + child: Utils.getWarningWidget( + loadingText: LocaleKeys.featureComingSoonDescription.tr(context: context), + isShowActionButtons: false, + showOkButton: true, + onConfirmTap: () async { + context.pop(); + } + ), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } }