|
|
|
@ -25,6 +25,12 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
return Consumer<HealthProvider>(builder: (context, healthProvider, child) {
|
|
|
|
|
|
|
|
if (healthProvider.error != null &&
|
|
|
|
|
|
|
|
healthProvider.error?.isNotEmpty == true) {
|
|
|
|
|
|
|
|
Utils.showToast(healthProvider.error!);
|
|
|
|
|
|
|
|
healthProvider.clearError();
|
|
|
|
|
|
|
|
}
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
body: CollapsingListView(
|
|
|
|
body: CollapsingListView(
|
|
|
|
@ -62,7 +68,8 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.h),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.h),
|
|
|
|
child: GridView(
|
|
|
|
child: GridView(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
@ -71,37 +78,55 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
crossAxisCount: 2,
|
|
|
|
crossAxisCount: 2,
|
|
|
|
crossAxisSpacing: 16.h,
|
|
|
|
crossAxisSpacing: 16.h,
|
|
|
|
mainAxisSpacing: 16.w,
|
|
|
|
mainAxisSpacing: 16.w,
|
|
|
|
childAspectRatio: isFoldable ? 1.1 : (isTablet ? 1.3 : 0.7),
|
|
|
|
childAspectRatio:
|
|
|
|
|
|
|
|
isFoldable ? 1.1 : (isTablet ? 1.3 : 0.7),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildImgWithAssets(icon: "assets/images/png/smartwatches/apple-watch-5.jpg", width: 136.h, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
|
|
|
Utils.buildImgWithAssets(
|
|
|
|
"Apple Watch".needTranslation.toText16(isBold: true),
|
|
|
|
icon:
|
|
|
|
|
|
|
|
"assets/images/png/smartwatches/apple-watch-5.jpg",
|
|
|
|
|
|
|
|
width: 136.h,
|
|
|
|
|
|
|
|
height: 136.h)
|
|
|
|
|
|
|
|
.paddingSymmetrical(24.w, 8.h),
|
|
|
|
|
|
|
|
"applewatch"
|
|
|
|
|
|
|
|
.tr()
|
|
|
|
|
|
|
|
.needTranslation
|
|
|
|
|
|
|
|
.toText16(isBold: true),
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: LocaleKeys.selectSmartWatch.tr(context: context),
|
|
|
|
text: LocaleKeys.selectSmartWatch
|
|
|
|
|
|
|
|
.tr(context: context),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
context
|
|
|
|
context.read<HealthProvider>().setSelectedWatchType(
|
|
|
|
.read<HealthProvider>()
|
|
|
|
SmartWatchTypes.apple,
|
|
|
|
.setSelectedWatchType(SmartWatchTypes.apple, "assets/images/png/smartwatches/apple-watch-5.jpg");
|
|
|
|
"assets/images/png/smartwatches/apple-watch-5.jpg");
|
|
|
|
getIt.get<NavigationService>().pushPage(
|
|
|
|
getIt.get<NavigationService>().pushPage(
|
|
|
|
page: SmartwatchInstructionsPage(
|
|
|
|
page: SmartwatchInstructionsPage(
|
|
|
|
smartwatchDetails: SmartwatchDetails(
|
|
|
|
smartwatchDetails: SmartwatchDetails(
|
|
|
|
SmartWatchTypes.apple,
|
|
|
|
SmartWatchTypes.apple,
|
|
|
|
"assets/images/png/smartwatches/apple-watch-5.jpg",
|
|
|
|
"assets/images/png/smartwatches/apple-watch-5.jpg",
|
|
|
|
AppAssets.bluetooth,
|
|
|
|
AppAssets.bluetooth,
|
|
|
|
LocaleKeys.applehealthapplicationshouldbeinstalledinyourphone.tr(context: context),
|
|
|
|
LocaleKeys
|
|
|
|
LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context),
|
|
|
|
.applehealthapplicationshouldbeinstalledinyourphone
|
|
|
|
LocaleKeys.applewatchshouldbeconnected.tr(context: context)),
|
|
|
|
.tr(context: context),
|
|
|
|
|
|
|
|
LocaleKeys
|
|
|
|
|
|
|
|
.unabletodetectapplicationinstalledpleasecomebackonceinstalled
|
|
|
|
|
|
|
|
.tr(context: context),
|
|
|
|
|
|
|
|
LocaleKeys.applewatchshouldbeconnected
|
|
|
|
|
|
|
|
.tr(context: context)),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
backgroundColor:
|
|
|
|
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
|
|
|
|
borderColor:
|
|
|
|
|
|
|
|
AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontSize: 14.f,
|
|
|
|
isBold: true,
|
|
|
|
isBold: true,
|
|
|
|
@ -112,31 +137,51 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
|
|
|
|
decoration: RoundedRectangleBorder()
|
|
|
|
|
|
|
|
.toSmoothCornerDecoration(
|
|
|
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
|
|
|
borderRadius: 24.r),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildImgWithAssets(icon: "assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg", fit: BoxFit.contain, width: 136.w, height: 136.h)
|
|
|
|
Utils.buildImgWithAssets(
|
|
|
|
|
|
|
|
icon:
|
|
|
|
|
|
|
|
"assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg",
|
|
|
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
|
|
|
width: 136.w,
|
|
|
|
|
|
|
|
height: 136.h)
|
|
|
|
.paddingSymmetrical(24.w, 8.h),
|
|
|
|
.paddingSymmetrical(24.w, 8.h),
|
|
|
|
"Samsung Watch".needTranslation.toText16(isBold: true),
|
|
|
|
"samsungwatch"
|
|
|
|
|
|
|
|
.tr()
|
|
|
|
|
|
|
|
.needTranslation
|
|
|
|
|
|
|
|
.toText16(isBold: true),
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: LocaleKeys.selectSmartWatch.tr(context: context),
|
|
|
|
text: LocaleKeys.selectSmartWatch
|
|
|
|
|
|
|
|
.tr(context: context),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
context
|
|
|
|
context.read<HealthProvider>().setSelectedWatchType(
|
|
|
|
.read<HealthProvider>()
|
|
|
|
SmartWatchTypes.samsung,
|
|
|
|
.setSelectedWatchType(SmartWatchTypes.samsung, "assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg");
|
|
|
|
"assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg");
|
|
|
|
getIt.get<NavigationService>().pushPage(
|
|
|
|
getIt.get<NavigationService>().pushPage(
|
|
|
|
page: SmartwatchInstructionsPage(
|
|
|
|
page: SmartwatchInstructionsPage(
|
|
|
|
smartwatchDetails: SmartwatchDetails(
|
|
|
|
smartwatchDetails: SmartwatchDetails(
|
|
|
|
SmartWatchTypes.samsung,
|
|
|
|
SmartWatchTypes.samsung,
|
|
|
|
"assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg",
|
|
|
|
"assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg",
|
|
|
|
AppAssets.bluetooth,
|
|
|
|
AppAssets.bluetooth,
|
|
|
|
LocaleKeys.samsunghealthapplicationshouldbeinstalledinyourphone.tr(context: context),
|
|
|
|
LocaleKeys
|
|
|
|
LocaleKeys.unabletodetectapplicationinstalledpleasecomebackonceinstalled.tr(context: context),
|
|
|
|
.samsunghealthapplicationshouldbeinstalledinyourphone
|
|
|
|
LocaleKeys.samsungwatchshouldbeconnected.tr(context: context)),
|
|
|
|
.tr(context: context),
|
|
|
|
|
|
|
|
LocaleKeys
|
|
|
|
|
|
|
|
.unabletodetectapplicationinstalledpleasecomebackonceinstalled
|
|
|
|
|
|
|
|
.tr(context: context),
|
|
|
|
|
|
|
|
LocaleKeys
|
|
|
|
|
|
|
|
.samsungwatchshouldbeconnected
|
|
|
|
|
|
|
|
.tr(context: context)),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
backgroundColor:
|
|
|
|
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
|
|
|
|
borderColor:
|
|
|
|
|
|
|
|
AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontSize: 14.f,
|
|
|
|
isBold: true,
|
|
|
|
isBold: true,
|
|
|
|
@ -147,30 +192,42 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildImgWithAssets(icon: "assets/images/png/smartwatches/Huawei_Watch.png", width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
|
|
|
Utils.buildImgWithAssets(
|
|
|
|
"Huawei Watch".needTranslation.toText16(isBold: true),
|
|
|
|
icon:
|
|
|
|
|
|
|
|
"assets/images/png/smartwatches/Huawei_Watch.png",
|
|
|
|
|
|
|
|
width: 136.w,
|
|
|
|
|
|
|
|
height: 136.h)
|
|
|
|
|
|
|
|
.paddingSymmetrical(24.w, 8.h),
|
|
|
|
|
|
|
|
"huaweiwatch"
|
|
|
|
|
|
|
|
.tr()
|
|
|
|
|
|
|
|
.needTranslation
|
|
|
|
|
|
|
|
.toText16(isBold: true),
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: LocaleKeys.selectSmartWatch.tr(context: context),
|
|
|
|
text: LocaleKeys.selectSmartWatch
|
|
|
|
|
|
|
|
.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);
|
|
|
|
showUnavailableDialog(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
backgroundColor:
|
|
|
|
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
|
|
|
|
borderColor:
|
|
|
|
|
|
|
|
AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontSize: 14.f,
|
|
|
|
isBold: true,
|
|
|
|
isBold: true,
|
|
|
|
@ -181,16 +238,26 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
borderRadius: 24.r,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Utils.buildImgWithAssets(icon: "assets/images/png/smartwatches/Whoop_Watch.png", width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
|
|
|
Utils.buildImgWithAssets(
|
|
|
|
"Whoop Watch".needTranslation.toText16(isBold: true),
|
|
|
|
icon:
|
|
|
|
|
|
|
|
"assets/images/png/smartwatches/Whoop_Watch.png",
|
|
|
|
|
|
|
|
width: 136.w,
|
|
|
|
|
|
|
|
height: 136.h)
|
|
|
|
|
|
|
|
.paddingSymmetrical(24.w, 8.h),
|
|
|
|
|
|
|
|
"whoopwatch"
|
|
|
|
|
|
|
|
.tr()
|
|
|
|
|
|
|
|
.needTranslation
|
|
|
|
|
|
|
|
.toText16(isBold: true),
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: LocaleKeys.selectSmartWatch.tr(context: context),
|
|
|
|
text: LocaleKeys.selectSmartWatch
|
|
|
|
|
|
|
|
.tr(context: context),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
showUnavailableDialog(context);
|
|
|
|
showUnavailableDialog(context);
|
|
|
|
// context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
|
|
|
|
// context.read<HealthProvider>().setSelectedWatchType(SmartWatchTypes.whoop, "assets/images/png/smartwatches/Whoop_Watch.png");
|
|
|
|
@ -203,8 +270,10 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
// LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)),
|
|
|
|
// LocaleKeys.whoopwatchshouldbeconnected.tr(context: context)),
|
|
|
|
// ));
|
|
|
|
// ));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
backgroundColor:
|
|
|
|
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
AppColors.primaryRedColor.withAlpha(40),
|
|
|
|
|
|
|
|
borderColor:
|
|
|
|
|
|
|
|
AppColors.primaryRedColor.withAlpha(0),
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
fontSize: 14.f,
|
|
|
|
fontSize: 14.f,
|
|
|
|
isBold: true,
|
|
|
|
isBold: true,
|
|
|
|
@ -222,6 +291,7 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void showUnavailableDialog(BuildContext context) {
|
|
|
|
void showUnavailableDialog(BuildContext context) {
|
|
|
|
@ -229,7 +299,8 @@ class SmartwatchHomePage extends StatelessWidget {
|
|
|
|
title: LocaleKeys.notice.tr(context: context),
|
|
|
|
title: LocaleKeys.notice.tr(context: context),
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
child: Utils.getWarningWidget(
|
|
|
|
child: Utils.getWarningWidget(
|
|
|
|
loadingText: LocaleKeys.featureComingSoonDescription.tr(context: context),
|
|
|
|
loadingText:
|
|
|
|
|
|
|
|
LocaleKeys.featureComingSoonDescription.tr(context: context),
|
|
|
|
isShowActionButtons: false,
|
|
|
|
isShowActionButtons: false,
|
|
|
|
showOkButton: true,
|
|
|
|
showOkButton: true,
|
|
|
|
onConfirmTap: () async {
|
|
|
|
onConfirmTap: () async {
|
|
|
|
|