warning dialog displayed to user if the watch intented is not currently implemented

translation-context
tahaalam 3 weeks ago
parent dda4dbeba9
commit 50d78551c2

@ -1597,5 +1597,6 @@
"continueCash": "متابعة الدفع نقدًا", "continueCash": "متابعة الدفع نقدًا",
"timeFor": "الوقت", "timeFor": "الوقت",
"hmgPolicies": "سياسات مجموعة الحبيب الطبية", "hmgPolicies": "سياسات مجموعة الحبيب الطبية",
"darkMode": "المظهر الداكن" "darkMode": "المظهر الداكن",
"featureComingSoonDescription": "هذه الميزة ستتوفر قريباً. نحن نعمل جاهدين لإضافة ميزات أكثر تميزاً إلى التطبيق. انتظرونا لمتابعة التحديثات."
} }

@ -1589,5 +1589,6 @@
"updatetheinformation": "This will allow to gather the most up to date information from your apple watch", "updatetheinformation": "This will allow to gather the most up to date information from your apple watch",
"timeFor": "Time For", "timeFor": "Time For",
"hmgPolicies": "HMG Policies", "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."
} }

@ -405,6 +405,7 @@ class Utils {
static Widget getWarningWidget({ static Widget getWarningWidget({
String? loadingText, String? loadingText,
bool isShowActionButtons = false, bool isShowActionButtons = false,
bool showOkButton = false,
Widget? bodyWidget, Widget? bodyWidget,
Function? onConfirmTap, Function? onConfirmTap,
Function? onCancelTap, 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; ).center;
} }

@ -1590,5 +1590,6 @@ abstract class LocaleKeys {
static const timeFor = 'timeFor'; static const timeFor = 'timeFor';
static const hmgPolicies = 'hmgPolicies'; static const hmgPolicies = 'hmgPolicies';
static const darkMode = 'darkMode'; static const darkMode = 'darkMode';
static const featureComingSoonDescription = 'featureComingSoonDescription';
} }

@ -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/common_models/smart_watch.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_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'; 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:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../core/utils/utils.dart';
class SmartwatchHomePage extends StatelessWidget { class SmartwatchHomePage extends StatelessWidget {
const SmartwatchHomePage({super.key}); const SmartwatchHomePage({super.key});
@ -149,15 +152,16 @@ class SmartwatchHomePage extends StatelessWidget {
CustomButton( CustomButton(
text: LocaleKeys.select.tr(context: context), text: LocaleKeys.select.tr(context: context),
onPressed: () { onPressed: () {
context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png"); // context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png");
getIt.get<NavigationService>().pushPage(page: SmartwatchInstructionsPage( // getIt.get<NavigationService>().pushPage(page: SmartwatchInstructionsPage(
smartwatchDetails: SmartwatchDetails(SmartWatchTypes.huawei, // smartwatchDetails: SmartwatchDetails(SmartWatchTypes.huawei,
"assets/images/png/smartwatches/Huawei_Watch.png", // "assets/images/png/smartwatches/Huawei_Watch.png",
AppAssets.bluetooth, // AppAssets.bluetooth,
LocaleKeys.huaweihealthapplicationshouldbeinstalledinyourphone.tr(context: context), // LocaleKeys.huaweihealthapplicationshouldbeinstalledinyourphone.tr(context: context),
LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), // LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context),
LocaleKeys.huaweiwatchshouldbeconnected.tr(context: context)), // LocaleKeys.huaweiwatchshouldbeconnected.tr(context: context)),
)); // ));
showUnavailableDialog(context);
}, },
backgroundColor: AppColors.primaryRedColor.withAlpha(40), backgroundColor: AppColors.primaryRedColor.withAlpha(40),
borderColor: AppColors.primaryRedColor.withAlpha(0), borderColor: AppColors.primaryRedColor.withAlpha(0),
@ -182,15 +186,17 @@ class SmartwatchHomePage extends StatelessWidget {
CustomButton( CustomButton(
text: LocaleKeys.select.tr(context: context), text: LocaleKeys.select.tr(context: context),
onPressed: () { onPressed: () {
context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
getIt.get<NavigationService>().pushPage(page: SmartwatchInstructionsPage( showUnavailableDialog(context);
smartwatchDetails: SmartwatchDetails(SmartWatchTypes.whoop, // context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
"assets/images/png/smartwatches/Whoop_Watch.png", // getIt.get<NavigationService>().pushPage(page: SmartwatchInstructionsPage(
AppAssets.bluetooth, // smartwatchDetails: SmartwatchDetails(SmartWatchTypes.whoop,
LocaleKeys.whoophealthapplicationshouldbeinstalledinyourphone.tr(context: context), // "assets/images/png/smartwatches/Whoop_Watch.png",
LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context), // AppAssets.bluetooth,
LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)), // LocaleKeys.whoophealthapplicationshouldbeinstalledinyourphone.tr(context: context),
)); // LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context),
// LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)),
// ));
}, },
backgroundColor: AppColors.primaryRedColor.withAlpha(40), backgroundColor: AppColors.primaryRedColor.withAlpha(40),
borderColor: AppColors.primaryRedColor.withAlpha(0), 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,
);
}
} }

Loading…
Cancel
Save