Merge pull request 'haroon_dev' (#171) from haroon_dev into master

Reviewed-on: https://34.17.182.140/Haroon6138/HMG_Patient_App_New/pulls/171
master
Haroon6138 1 day ago
commit c50f8d63ef

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

@ -702,6 +702,8 @@ class ApiConsts {
static String QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
static String CHAT_URL = "https://chat.hmg.com/Index.aspx?RequestedId=";
// static String GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments";
// var payFortEnvironment = FortEnvironment.test;
@ -719,6 +721,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/Index.aspx?RequestedId=";
break;
case AppEnvironmentTypeEnum.dev:
baseUrl = "https://uat.hmgwebservices.com/";
@ -730,6 +733,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/uat/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId";
break;
case AppEnvironmentTypeEnum.uat:
baseUrl = "https://uat.hmgwebservices.com/";
@ -741,6 +745,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/uat/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId";
break;
case AppEnvironmentTypeEnum.preProd:
baseUrl = "https://webservices.hmg.com/";
@ -752,6 +757,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId";
break;
case AppEnvironmentTypeEnum.qa:
baseUrl = "https://uat.hmgwebservices.com/";
@ -763,6 +769,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/uat/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId";
break;
case AppEnvironmentTypeEnum.staging:
baseUrl = "https://uat.hmgwebservices.com/";
@ -774,6 +781,7 @@ class ApiConsts {
GET_TAMARA_PAYMENT_STATUS = 'https://epharmacy.hmg.com/tamara/api/OnlineTamara/order_status?orderid=';
rcBaseUrl = 'https://rc.hmg.com/uat/';
QLINE_URL = "https://ms.hmg.com/nscapi/api/PatientCall/PatientInQueue_Detail";
CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId";
break;
}
}

@ -112,7 +112,8 @@ class RadiologyViewModel extends ChangeNotifier {
final result = await radiologyRepo.getRadiologyImage(patientRadiologyResponseModel: patientRadiologyResponseModel);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
// (failure) async => await errorHandlerService.handleError(failure: failure),
(failure) async {},
(apiResponse) {
if (apiResponse.messageStatus == 2) {
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});

@ -10,6 +10,15 @@ class HealthProvider with ChangeNotifier {
String selectedTimeRange = '7D';
int selectedTabIndex = 0;
String selectedWatchType = 'apple';
String selectedWatchURL = 'assets/images/png/smartwatches/apple-watch-5.jpg';
setSelectedWatchType(String type, String imageURL) {
selectedWatchType = type;
selectedWatchURL = imageURL;
notifyListeners();
}
void onTabChanged(int index) {
selectedTabIndex = index;
notifyListeners();

@ -1,6 +1,7 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
import 'package:hmg_patient_app_new/core/api_consts.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
@ -8,12 +9,17 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/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/authentication/authentication_view_model.dart';
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/home/navigation_screen.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/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:lottie/lottie.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -23,10 +29,12 @@ class LiveChatPage extends StatelessWidget {
String chatURL = "";
late AppState appState;
late AuthenticationViewModel authVm;
@override
Widget build(BuildContext context) {
appState = getIt.get<AppState>();
authVm = context.read<AuthenticationViewModel>();
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) {
@ -158,13 +166,71 @@ class LiveChatPage extends StatelessWidget {
child: CustomButton(
text: LocaleKeys.liveChat.tr(context: context),
onPressed: () async {
if (contactUsVM.chatRequestID != null) {
chatURL = "https://chat.hmg.com/Index.aspx?RequestedId=${contactUsVM.chatRequestID}";
debugPrint("Chat URL: $chatURL");
Uri uri = Uri.parse(chatURL);
launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: "");
if(appState.isAuthenticated) {
if (contactUsVM.chatRequestID != null) {
chatURL = "${ApiConsts.CHAT_URL}${contactUsVM.chatRequestID}";
debugPrint("Chat URL: $chatURL");
Uri uri = Uri.parse(chatURL);
launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: "");
} else {
debugPrint("Chat Request ID is null");
}
} else {
debugPrint("Chat Request ID is null");
showCommonBottomSheetWithoutHeight(
context,
title: LocaleKeys.notice.tr(context: context),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Lottie.asset(AppAnimations.errorAnimation, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(LocaleKeys.loginToUseService.tr(context: context)).toText16(color: AppColors.blackColor),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
child: CustomButton(
text: LocaleKeys.cancel.tr(context: context),
onPressed: () {
Navigator.of(context).pop();
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
icon: AppAssets.cancel,
iconColor: AppColors.primaryRedColor,
),
),
SizedBox(width: 8.h),
Expanded(
child: CustomButton(
text: LocaleKeys.confirm.tr(context: context),
onPressed: () async {
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(
context,
CustomPageRoute(
page: LandingNavigation(),
),
(r) => false);
await authVm.onLoginPressed();
},
backgroundColor: AppColors.bgGreenColor,
borderColor: AppColors.bgGreenColor,
textColor: Colors.white,
icon: AppAssets.confirm,
),
),
],
),
SizedBox(height: 16.h),
],
).center,
callBackFunc: () {},
isFullScreen: false,
isCloseButtonVisible: true,
);
}
},
backgroundColor: contactUsVM.selectedLiveChatProjectIndex == -1 ? AppColors.greyColor : AppColors.primaryRedColor,

@ -50,7 +50,7 @@ class _FamilyMedicalScreenState extends State<FamilyMedicalScreen> {
AppState appState = getIt.get<AppState>();
return CollapsingListView(
title: LocaleKeys.medicalFiles.tr(context: context),
title: LocaleKeys.familyTitle.tr(context: context),
bottomChild: appState.getAuthenticatedUser()!.isParentUser!
? Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(

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

@ -1,19 +1,12 @@
import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:health/health.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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/smartwatches/health_dashboard/health_dashboard.dart';
import 'package:hmg_patient_app_new/services/dialog_service.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/routes/custom_page_route.dart';
import 'package:url_launcher/url_launcher.dart';
class SmartwatchInstructionsPage extends StatelessWidget {
const SmartwatchInstructionsPage({super.key});
@ -22,445 +15,28 @@ class SmartwatchInstructionsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: CollapsingListView(
title: LocaleKeys.smartWatches.tr(),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 24.h),
child: SingleChildScrollView(
child: Platform.isIOS ? getIOSInstructionsUI(context) : getAndroidInstructionsUI(context),
),
),
),
);
}
Widget getAndroidInstructionsUI(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocaleKeys.supportedSmartWatches.tr().toText20(isBold: true),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_watch_ultra.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Watch Ultra", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_watch_8_classic.jpeg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Watch 8 Classic", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_watch_8.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Watch 8", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_watch_7_classic.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Watch 7 Classic", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_watch_7.webp", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Watch 7", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/galaxy_fit_3.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Galaxy Fit3", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
),
),
SizedBox(height: 12),
LocaleKeys.pleaseMakeSureSamsungWatchConnected.tr().toText14(isBold: true),
SizedBox(height: 8.h),
LocaleKeys.beforeSyncingDataFollowInstructions.tr().toText14(isBold: true),
SizedBox(height: 12),
InkWell(
onTap: () {
showInstructionsDialog(context);
},
child: LocaleKeys.viewWatchInstructions.tr().toText12(isBold: true, color: AppColors.textColor, isUnderLine: true)),
SizedBox(
height: 130.h,
),
CustomButton(
text: LocaleKeys.confirm.tr(context: context),
onPressed: () async {
await Health().getHealthConnectSdkStatus().then((val) {
print('Health Connect SDK Status: $val');
if (val == HealthConnectSdkStatus.sdkAvailable) {
Navigator.of(context).push(
CustomPageRoute(
page: HealthDashboard(),
),
);
} else {
getIt.get<DialogService>().showErrorBottomSheet(
message: LocaleKeys.healthConnectAppNotInstalled.tr(),
onOkPressed: () {
Navigator.pop(context);
Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata");
launchUrl(uri, mode: LaunchMode.externalApplication);
});
return;
}
});
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16.f,
fontWeight: FontWeight.w500,
borderRadius: 10.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
iconColor: AppColors.whiteColor,
iconSize: 18.h,
),
// DefaultButton(
// LocaleKeys.confirm.tr(context: context),
// () async {
// await Health().getHealthConnectSdkStatus().then((val) {
// print('Health Connect SDK Status: $val');
// if (val == HealthConnectSdkStatus.sdkAvailable) {
// Navigator.of(context).push(
// FadePage(
// page: HealthDashboard(), // Replace with the actual vital signs page
// // page: HealthApp(), // Replace with the actual vital signs page
// ),
// );
// } else {
// Utils.showAppDialog(context, LocaleKeys.error.tr(context: context), LocaleKeys.healthConnectNotInstalled.tr(), () {
// Navigator.pop(context);
// Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.apps.healthdata");
// launchUrl(uri, mode: LaunchMode.externalApplication);
// });
// return;
// }
// });
// },
// )
],
);
}
Widget getIOSInstructionsUI(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Supported Smart Watches".needTranslation.toText20(isBold: true),
SizedBox(height: 16.h),
Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/apple-watch-1.jpeg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 5", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
body: CollapsingListView(
title: "How does it work".needTranslation,
bottomChild: Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.r,
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/apple-watch-2.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 6", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/apple-watch-3.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 7", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/apple-watch-4.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 8", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/apple-watch-5.jpg", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 9", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 15.0),
child: Row(
children: [
Image.asset("assets/images/png/smartwatches/Apple-Watch-6.png", width: 70.0, height: 70.0),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Container(
width: MediaQuery.of(context).size.width * 0.21,
child: Text("Apple Watch Series 10", overflow: TextOverflow.clip, style: TextStyle(fontSize: 12.0)),
),
)
],
),
),
),
],
child: CustomButton(
text: LocaleKeys.getStarted.tr(context: context),
onPressed: () {
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
height: 50.h,
).paddingSymmetrical(24.w, 30.h),
),
child: SingleChildScrollView(),
),
SizedBox(height: 12),
"Please make sure that your Apple Watch is connected to your iPhone, is actively synced & updated.".toText14(isBold: true),
SizedBox(height: 12),
"Before syncing data, please make sure that you have followed the instructions properly.".toText14(isBold: true),
SizedBox(height: 12),
InkWell(
onTap: () {
showInstructionsDialog(context);
},
child: "View watch instructions".toText12(isBold: true, color: AppColors.textColor, isUnderLine: true),
),
SizedBox(
height: 130.h,
),
CustomButton(
text: LocaleKeys.confirm.tr(context: context),
onPressed: () async {
Navigator.of(context).push(
CustomPageRoute(
page: HealthDashboard(),
),
);
},
backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,
fontSize: 16.f,
fontWeight: FontWeight.w500,
borderRadius: 10.r,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 50.h,
iconColor: AppColors.whiteColor,
iconSize: 18.h,
),
],
);
}
showInstructionsDialog(BuildContext context) {
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 350.0,
padding: EdgeInsets.all(21),
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"SmartWatch Tracker".toText18(),
IconButton(
icon: Icon(
Icons.close,
color: Color(0xff2E303A),
),
onPressed: () {
Navigator.pop(context);
},
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(Platform.isIOS
? "Make sure that you have installed 'Health' App & 'Watch' App from Apple Store."
: "Please make sure that your Samsung Watch is connected to your Phone, is actively synced & updated.")
.needTranslation
.toText14(),
SizedBox(height: 12),
],
)
],
),
),
],
),
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {
return SizedBox();
//Chanbged By Aamir
});
}
}

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

@ -18,7 +18,7 @@ import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart';
import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_procedures_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/presentation/smartwatches/huawei_health_example.dart';
import 'package:hmg_patient_app_new/presentation/smartwatches/smartwatch_instructions_page.dart';
import 'package:hmg_patient_app_new/presentation/smartwatches/smartwatch_home_page.dart';
import 'package:hmg_patient_app_new/presentation/symptoms_checker/organ_selector_screen.dart';
import 'package:hmg_patient_app_new/presentation/symptoms_checker/possible_conditions_screen.dart';
import 'package:hmg_patient_app_new/presentation/symptoms_checker/risk_factors_screen.dart';
@ -110,7 +110,7 @@ class AppRoutes {
bookAppointmentPage: (context) => BookAppointmentPage(),
userInfoSelection: (context) => UserInfoSelectionPage(),
userInfoFlowManager: (context) => UserInfoFlowManager(),
smartWatches: (context) => SmartwatchInstructionsPage(),
smartWatches: (context) => SmartwatchHomePage(),
huaweiHealthExample: (context) => HuaweiHealthExample(),
covid19Test: (context) => Covid19LandingPage(),
waterConsumptionPage: (context) => WaterConsumptionPage(),

@ -165,7 +165,7 @@ class DialogServiceImp implements DialogService {
SizedBox(height: isShowManageButton ? 15.h : 24.h),
if (isShowManageButton)
CustomButton(
text: "ManageFamilyFiles",
text: LocaleKeys.manageFiles.tr(context: context),
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedBorderColor,

Loading…
Cancel
Save