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