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

watch_integration
tahaalam 2 weeks ago
parent dda4dbeba9
commit 50d78551c2

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

@ -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."
}

@ -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;
}

@ -1590,5 +1590,6 @@ abstract class LocaleKeys {
static const timeFor = 'timeFor';
static const hmgPolicies = 'hmgPolicies';
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/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<HealthProvider>().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png");
getIt.get<NavigationService>().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<HealthProvider>().setSelectedWatchType(SmartWatchTypes.huawei, "assets/images/png/smartwatches/Huawei_Watch.png");
// getIt.get<NavigationService>().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<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
getIt.get<NavigationService>().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<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
// getIt.get<NavigationService>().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,
);
}
}

Loading…
Cancel
Save