Merge pull request 'haroon_dev' (#171) from haroon_dev into master
Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/171master
commit
c50f8d63ef
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,180 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.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';
|
||||
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||
import 'package:hmg_patient_app_new/presentation/smartwatches/widgets/supported_watches_list.dart';
|
||||
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||
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';
|
||||
|
||||
class SmartwatchHomePage extends StatelessWidget {
|
||||
const SmartwatchHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.bgScaffoldColor,
|
||||
body: CollapsingListView(
|
||||
title: LocaleKeys.smartWatches.tr(),
|
||||
bottomChild: Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
),
|
||||
child: CustomButton(
|
||||
text: LocaleKeys.supportedSmartWatches.tr(context: context),
|
||||
onPressed: () {
|
||||
showCommonBottomSheetWithoutHeight(
|
||||
title: LocaleKeys.supportedSmartWatches.tr(context: context),
|
||||
context,
|
||||
child: SupportedWatchesList(),
|
||||
callBackFunc: () {},
|
||||
isFullScreen: false,
|
||||
isCloseButtonVisible: true,
|
||||
);
|
||||
},
|
||||
backgroundColor: AppColors.infoColor.withAlpha(40),
|
||||
borderColor: AppColors.infoColor.withAlpha(0),
|
||||
textColor: AppColors.infoColor,
|
||||
fontSize: 16.f,
|
||||
fontWeight: FontWeight.w500,
|
||||
borderRadius: 12.r,
|
||||
height: 50.h,
|
||||
icon: AppAssets.ask_doctor_icon,
|
||||
iconColor: AppColors.infoColor,
|
||||
iconSize: 18.h,
|
||||
).paddingSymmetrical(24.w, 30.h),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 24.h),
|
||||
child: GridView(
|
||||
padding: EdgeInsets.zero,
|
||||
shrinkWrap: true,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 16.h,
|
||||
mainAxisSpacing: 16.w,
|
||||
mainAxisExtent: 240.h,
|
||||
),
|
||||
children: [
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset("assets/images/png/smartwatches/apple-watch-5.jpg", width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
||||
"Apple Watch".needTranslation.toText16(isBold: true),
|
||||
CustomButton(
|
||||
text: LocaleKeys.select.tr(context: context),
|
||||
onPressed: () {
|
||||
context.read<HealthProvider>().setSelectedWatchType("apple", "assets/images/png/smartwatches/apple-watch-5.jpg");
|
||||
},
|
||||
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
||||
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
||||
textColor: AppColors.primaryRedColor,
|
||||
fontSize: 16.f,
|
||||
fontWeight: FontWeight.w500,
|
||||
borderRadius: 12.r,
|
||||
height: 40.h,
|
||||
).paddingSymmetrical(16.w, 12.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset("assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg", fit: BoxFit.contain, width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
||||
"Samsung Watch".needTranslation.toText16(isBold: true),
|
||||
CustomButton(
|
||||
text: LocaleKeys.select.tr(context: context),
|
||||
onPressed: () {
|
||||
context.read<HealthProvider>().setSelectedWatchType("samsung", "assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg");
|
||||
},
|
||||
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
||||
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
||||
textColor: AppColors.primaryRedColor,
|
||||
fontSize: 16.f,
|
||||
fontWeight: FontWeight.w500,
|
||||
borderRadius: 12.r,
|
||||
height: 40.h,
|
||||
).paddingSymmetrical(16.w, 12.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset("assets/images/png/smartwatches/Huawei_Watch.png", width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
||||
"Huawei Watch".needTranslation.toText16(isBold: true),
|
||||
CustomButton(
|
||||
text: LocaleKeys.select.tr(context: context),
|
||||
onPressed: () {
|
||||
context.read<HealthProvider>().setSelectedWatchType("huawei", "assets/images/png/smartwatches/Huawei_Watch.png");
|
||||
},
|
||||
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
||||
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
||||
textColor: AppColors.primaryRedColor,
|
||||
fontSize: 16.f,
|
||||
fontWeight: FontWeight.w500,
|
||||
borderRadius: 12.r,
|
||||
height: 40.h,
|
||||
).paddingSymmetrical(16.w, 12.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 24.r,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset("assets/images/png/smartwatches/Whoop_Watch.png", width: 136.w, height: 136.h).paddingSymmetrical(24.w, 8.h),
|
||||
"Whoop Watch".needTranslation.toText16(isBold: true),
|
||||
CustomButton(
|
||||
text: LocaleKeys.select.tr(context: context),
|
||||
onPressed: () {
|
||||
context.read<HealthProvider>().setSelectedWatchType("whoop", "assets/images/png/smartwatches/Whoop_Watch.png");
|
||||
},
|
||||
backgroundColor: AppColors.primaryRedColor.withAlpha(40),
|
||||
borderColor: AppColors.primaryRedColor.withAlpha(0),
|
||||
textColor: AppColors.primaryRedColor,
|
||||
fontSize: 16.f,
|
||||
fontWeight: FontWeight.w500,
|
||||
borderRadius: 12.r,
|
||||
height: 40.h,
|
||||
).paddingSymmetrical(16.w, 12.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hmg_patient_app_new/core/utils/size_utils.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/theme/colors.dart';
|
||||
|
||||
class SupportedWatchesList extends StatelessWidget {
|
||||
const SupportedWatchesList({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||
color: AppColors.whiteColor,
|
||||
borderRadius: 20.r,
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
"Apple Watches".needTranslation.toText16(isBold: true),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
"• Apple Watch Ultra".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Apple Watch 11".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Apple Watch 10".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Apple Watch 9".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Apple Watch 8".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
SizedBox(height: 16.h),
|
||||
Row(
|
||||
children: [
|
||||
"Samsung Watches".needTranslation.toText16(isBold: true),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
"• Samsung Watch Ultra".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Galaxy Watch 8".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Galaxy Watch 7".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Galaxy Watch 6".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Galaxy Watch FE".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Galaxy Watch Fit".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
SizedBox(height: 16.h),
|
||||
Row(
|
||||
children: [
|
||||
"Huawei Watches".needTranslation.toText16(isBold: true),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
"• Huawei Watch Ultimate Series".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Huawei Watch Series".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Huawei Watch Fit Series".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Huawei Watch Bands".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
SizedBox(height: 16.h),
|
||||
Row(
|
||||
children: [
|
||||
"Whoop Watches".needTranslation.toText16(isBold: true),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
"• Whoop 1".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
"• Whoop 2".needTranslation.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue