diff --git a/assets/images/png/blood_donation_image.png b/assets/images/png/blood_donation_image.png new file mode 100644 index 00000000..c7e82c7f Binary files /dev/null and b/assets/images/png/blood_donation_image.png differ diff --git a/assets/images/png/cmc_services_image.png b/assets/images/png/cmc_services_image.png new file mode 100644 index 00000000..baad76de Binary files /dev/null and b/assets/images/png/cmc_services_image.png differ diff --git a/assets/images/png/emergency_services_image.png b/assets/images/png/emergency_services_image.png new file mode 100644 index 00000000..f9924a52 Binary files /dev/null and b/assets/images/png/emergency_services_image.png differ diff --git a/assets/images/png/ereferral_services_image.png b/assets/images/png/ereferral_services_image.png new file mode 100644 index 00000000..15194b59 Binary files /dev/null and b/assets/images/png/ereferral_services_image.png differ diff --git a/assets/images/png/water_consumption_image.png b/assets/images/png/water_consumption_image.png new file mode 100644 index 00000000..604fa8a2 Binary files /dev/null and b/assets/images/png/water_consumption_image.png differ diff --git a/lib/core/app_assets.dart b/lib/core/app_assets.dart index 96d196ae..3ef55b46 100644 --- a/lib/core/app_assets.dart +++ b/lib/core/app_assets.dart @@ -359,6 +359,11 @@ class AppAssets { static const String homeHealthCareService = '$pngBasePath/home_health_care.png'; static const String pharmacyService = '$pngBasePath/pharmacy_service.png'; + static const String bloodDonationService = '$pngBasePath/blood_donation_image.png'; + static const String waterConsumptionService = '$pngBasePath/water_consumption_image.png'; + static const String emergencyService = '$pngBasePath/emergency_services_image.png'; + static const String cmcService = '$pngBasePath/cmc_services_image.png'; + static const String eReferralService = '$pngBasePath/ereferral_services_image.png'; static const String maleImg = '$pngBasePath/male_img.png'; static const String femaleImg = '$pngBasePath/female_img.png'; diff --git a/lib/presentation/contact_us/contact_us.dart b/lib/presentation/contact_us/contact_us.dart index 70ef6e3f..602fc3b2 100644 --- a/lib/presentation/contact_us/contact_us.dart +++ b/lib/presentation/contact_us/contact_us.dart @@ -14,6 +14,8 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/find_us_page.dart'; import 'package:hmg_patient_app_new/presentation/contact_us/live_chat_page.dart'; +import 'package:hmg_patient_app_new/presentation/home/service_info_page.dart'; +import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; @@ -80,15 +82,23 @@ class ContactUs extends StatelessWidget { LocaleKeys.liveChat.tr(), LocaleKeys.liveChatWithHMG.tr(), ).onPress(() { - locationUtils.getCurrentLocation(onSuccess: (value) { - contactUsViewModel.getLiveChatProjectsList(); - Navigator.pop(context); + if (getIt.get().isAuthenticated) { Navigator.of(context).push( CustomPageRoute( page: LiveChatPage(), ), ); - }); + } else { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.liveChat.tr(), + serviceHeader: "HMG Hospital E-Referral: Streamlined patient referrals".needTranslation, + serviceDescription: "Facilitate seamless patient transfers to HMG with our secure e-referral system. Ensure continuity of care for every patient.".needTranslation, + serviceImage: AppAssets.eReferralService), + ), + ); + } }), ], ); diff --git a/lib/presentation/emergency_services/emergency_services_page.dart b/lib/presentation/emergency_services/emergency_services_page.dart index 74fddc16..801f6ca2 100644 --- a/lib/presentation/emergency_services/emergency_services_page.dart +++ b/lib/presentation/emergency_services/emergency_services_page.dart @@ -1,6 +1,8 @@ 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/app_state.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/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; @@ -14,6 +16,7 @@ import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulan import 'package:hmg_patient_app_new/presentation/emergency_services/call_ambulance/widgets/pickup_location.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/er_online_checkin/er_online_checkin_home.dart'; import 'package:hmg_patient_app_new/presentation/emergency_services/history/er_history_listing.dart'; +import 'package:hmg_patient_app_new/presentation/home/service_info_page.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'; @@ -23,23 +26,46 @@ import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:lottie/lottie.dart'; import 'package:provider/provider.dart'; -class EmergencyServicesPage extends StatelessWidget { +class EmergencyServicesPage extends StatefulWidget { EmergencyServicesPage({super.key}); + @override + State createState() => _EmergencyServicesPageState(); +} + +class _EmergencyServicesPageState extends State { late EmergencyServicesViewModel emergencyServicesViewModel; - _handleConfirmationBottomSheet() {} + late AppState appState; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (appState.isAuthenticated) { + emergencyServicesViewModel.flushData(); + emergencyServicesViewModel.getTransportationOrders( + showLoader: false, + ); + emergencyServicesViewModel.getRRTOrders( + showLoader: false, + ); + } + }); + } @override Widget build(BuildContext context) { emergencyServicesViewModel = Provider.of(context, listen: false); - + appState = getIt.get(); return CollapsingListView( title: LocaleKeys.emergencyServices.tr(), - history: () { - emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL); - Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up)); - }, + history: appState.isAuthenticated + ? () { + emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL); + Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up)); + } + : null, child: Padding( padding: EdgeInsets.all(24.h), child: Column( @@ -61,8 +87,7 @@ class EmergencyServicesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.callAmbulance.tr().toText16(isBold: true, color: AppColors.blackColor), - LocaleKeys.requestAmbulanceInEmergency.tr() - .toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), + LocaleKeys.requestAmbulanceInEmergency.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), ], ), ), @@ -70,65 +95,75 @@ class EmergencyServicesPage extends StatelessWidget { Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), ], ).onPress(() { - showCommonBottomSheetWithoutHeight( - context, - child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.primaryRedColor, - borderRadius: 24.h, - ), - child: Padding( - padding: EdgeInsets.all(24.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - "".toText14(), - Utils.buildSvgWithAssets( - icon: AppAssets.cancel_circle_icon, - iconColor: Colors.white, - width: 24.h, - height: 24.h, - fit: BoxFit.contain, - ).onPress(() { + if(appState.isAuthenticated) { + showCommonBottomSheetWithoutHeight( + context, + child: Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.primaryRedColor, + borderRadius: 24.h, + ), + child: Padding( + padding: EdgeInsets.all(24.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + "".toText14(), + Utils.buildSvgWithAssets( + icon: AppAssets.cancel_circle_icon, + iconColor: Colors.white, + width: 24.h, + height: 24.h, + fit: BoxFit.contain, + ).onPress(() { + Navigator.of(context).pop(); + }), + ], + ), + Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), + SizedBox(height: 8.h), + LocaleKeys.confirmation.tr().toText28(color: Colors.white, isBold: true), + SizedBox(height: 8.h), + LocaleKeys.areYouSureYouWantToCallAmbulance.tr().toText14(color: Colors.white, weight: FontWeight.w500), + SizedBox(height: 24.h), + CustomButton( + text: LocaleKeys.confirm.tr(context: context), + onPressed: () async { Navigator.of(context).pop(); - }), - ], - ), - Lottie.asset(AppAnimations.ambulanceAlert, - repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), - SizedBox(height: 8.h), - LocaleKeys.confirmation.tr().toText28(color: Colors.white, isBold: true), - SizedBox(height: 8.h), - LocaleKeys.areYouSureYouWantToCallAmbulance.tr() - .toText14(color: Colors.white, weight: FontWeight.w500), - SizedBox(height: 24.h), - CustomButton( - text: LocaleKeys.confirm.tr(context: context), - onPressed: () async { - Navigator.of(context).pop(); - await emergencyServicesViewModel.getTransportationOption(); - openTranportationSelectionBottomSheet(context); - }, - backgroundColor: Colors.white, - borderColor: Colors.white, - textColor: AppColors.primaryRedColor, - icon: AppAssets.checkmark_icon, - iconColor: AppColors.primaryRedColor, - ), - SizedBox(height: 8.h), - ], + await emergencyServicesViewModel.getTransportationOption(); + openTranportationSelectionBottomSheet(context); + }, + backgroundColor: Colors.white, + borderColor: Colors.white, + textColor: AppColors.primaryRedColor, + icon: AppAssets.checkmark_icon, + iconColor: AppColors.primaryRedColor, + ), + SizedBox(height: 8.h), + ], + ), ), ), - ), - isFullScreen: false, - isCloseButtonVisible: false, - hasBottomPadding: false, - backgroundColor: AppColors.primaryRedColor, - callBackFunc: () {}, - ); + isFullScreen: false, + isCloseButtonVisible: false, + hasBottomPadding: false, + backgroundColor: AppColors.primaryRedColor, + callBackFunc: () {}, + ); + } else { + Navigator.of(context).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.emergencyServices.tr(), + serviceHeader: "ER Check-in, Faster Than Ever. Call ambulance / Rapid Response Team instantly".needTranslation, + serviceDescription: "In a medical emergency? Our ambulances and rapid response teams are on standby 24/7. Plus, quick ER check-in for faster care.".needTranslation, + serviceImage: AppAssets.emergencyService), + ), + ); + } }), ), SizedBox(height: 16.h), @@ -148,8 +183,7 @@ class EmergencyServicesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.nearester.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), - LocaleKeys.getDetailsOfNearestBranch.tr() - .toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), + LocaleKeys.getDetailsOfNearestBranch.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), ], ), ), @@ -177,8 +211,7 @@ class EmergencyServicesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ LocaleKeys.rapidResponseTeam.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), - "Comprehensive medical service for all sorts of urgent and stable cases" - .toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), + "Comprehensive medical service for all sorts of urgent and stable cases".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), ], ), ), @@ -186,112 +219,14 @@ class EmergencyServicesPage extends StatelessWidget { Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), ], ).onPress(() { - showCommonBottomSheetWithoutHeight( - context, - child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.primaryRedColor, - borderRadius: 24.h, - ), - child: Padding( - padding: EdgeInsets.all(24.h), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), - SizedBox(height: 8.h), - LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), - SizedBox(height: 8.h), - LocaleKeys.areYouSureYouWantToCallRRT.tr() - .toText14(color: Colors.white, weight: FontWeight.w500), - SizedBox(height: 24.h), - CustomButton( - text: LocaleKeys.confirm.tr(context: context), - onPressed: () async { - Navigator.of(context).pop(); - - LoaderBottomSheet.showLoader(); - emergencyServicesViewModel.clearRRTData(); - await emergencyServicesViewModel.getRRTProcedures(onSuccess: (val) { - LoaderBottomSheet.hideLoader(); - showCommonBottomSheetWithoutHeight( - padding: EdgeInsets.only(top: 24.h), - titleWidget: Transform.flip( - flipX: emergencyServicesViewModel.isArabic, - child: Utils.buildSvgWithAssets( - icon: AppAssets.arrow_back, - iconColor: Color(0xff2B353E), - fit: BoxFit.contain, - ), - ).onPress(() { - - Navigator.pop(context); - }), - // title: "Rapid Response Team (RRT)".needTranslation, - context, - child: RrtRequestTypeSelect(), - isFullScreen: false, - isCloseButtonVisible: true, - hasBottomPadding: false, - backgroundColor: AppColors.bottomSheetBgColor, - callBackFunc: () {}, - ); - }); - }, - backgroundColor: Colors.white, - borderColor: Colors.white, - textColor: AppColors.primaryRedColor, - icon: AppAssets.checkmark_icon, - iconColor: AppColors.primaryRedColor, - ), - SizedBox(height: 8.h), - ], - ), - ), - ), - isFullScreen: false, - isCloseButtonVisible: false, - hasBottomPadding: false, - backgroundColor: AppColors.primaryRedColor, - callBackFunc: () { - context.read().setTermsAndConditions(false); - }, - ); - }), - ), - SizedBox(height: 16.h), - Container( - padding: EdgeInsets.all(16.h), - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.h, - hasShadow: false, - ), - child: Row( - children: [ - Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h, applyThemeColor: false), - SizedBox(width: 12.h), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - LocaleKeys.emergencyCheckIn.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), - LocaleKeys.priorERCheckInToSkipLine.tr() - .toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), - ], - ), - ), - SizedBox(width: 12.h), - Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), - ], - ).onPress(() { - if (emergencyServicesViewModel.patientHasAdvanceERBalance) { - Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); - } else { + if(appState.isAuthenticated) { showCommonBottomSheetWithoutHeight( context, child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.primaryRedColor, borderRadius: 24.h), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.primaryRedColor, + borderRadius: 24.h, + ), child: Padding( padding: EdgeInsets.all(24.h), child: Column( @@ -303,7 +238,7 @@ class EmergencyServicesPage extends StatelessWidget { "".toText14(), Utils.buildSvgWithAssets( icon: AppAssets.cancel_circle_icon, - iconColor: AppColors.whiteColor, + iconColor: Colors.white, width: 24.h, height: 24.h, fit: BoxFit.contain, @@ -316,16 +251,37 @@ class EmergencyServicesPage extends StatelessWidget { SizedBox(height: 8.h), LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), SizedBox(height: 8.h), - LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: Colors.white, weight: FontWeight.w500), + LocaleKeys.areYouSureYouWantToCallRRT.tr().toText14(color: Colors.white, weight: FontWeight.w500), SizedBox(height: 24.h), CustomButton( text: LocaleKeys.confirm.tr(context: context), onPressed: () async { Navigator.of(context).pop(); - LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingYourERAppointmentStatus.tr()); - await context.read().checkPatientERAdvanceBalance(onSuccess: (dynamic response) { + LoaderBottomSheet.showLoader(); + emergencyServicesViewModel.clearRRTData(); + await emergencyServicesViewModel.getRRTProcedures(onSuccess: (val) { LoaderBottomSheet.hideLoader(); - context.read().navigateToEROnlineCheckIn(); + showCommonBottomSheetWithoutHeight( + padding: EdgeInsets.only(top: 24.h), + titleWidget: Transform.flip( + flipX: emergencyServicesViewModel.isArabic, + child: Utils.buildSvgWithAssets( + icon: AppAssets.arrow_back, + iconColor: Color(0xff2B353E), + fit: BoxFit.contain, + ), + ).onPress(() { + Navigator.pop(context); + }), + // title: "Rapid Response Team (RRT)".needTranslation, + context, + child: RrtRequestTypeSelect(), + isFullScreen: false, + isCloseButtonVisible: true, + hasBottomPadding: false, + backgroundColor: AppColors.bottomSheetBgColor, + callBackFunc: () {}, + ); }); }, backgroundColor: Colors.white, @@ -343,7 +299,119 @@ class EmergencyServicesPage extends StatelessWidget { isCloseButtonVisible: false, hasBottomPadding: false, backgroundColor: AppColors.primaryRedColor, - callBackFunc: () {}, + callBackFunc: () { + context.read().setTermsAndConditions(false); + }, + ); + } else { + Navigator.of(context).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.emergencyServices.tr(), + serviceHeader: "ER Check-in, Faster Than Ever. Call ambulance / Rapid Response Team instantly".needTranslation, + serviceDescription: "In a medical emergency? Our ambulances and rapid response teams are on standby 24/7. Plus, quick ER check-in for faster care.".needTranslation, + serviceImage: AppAssets.emergencyService), + ), + ); + } + }), + ), + SizedBox(height: 16.h), + Container( + padding: EdgeInsets.all(16.h), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 20.h, + hasShadow: false, + ), + child: Row( + children: [ + Utils.buildSvgWithAssets(icon: AppAssets.rrt_icon, width: 40.h, height: 40.h, applyThemeColor: false), + SizedBox(width: 12.h), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LocaleKeys.emergencyCheckIn.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), + LocaleKeys.priorERCheckInToSkipLine.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500), + ], + ), + ), + SizedBox(width: 12.h), + Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), + ], + ).onPress(() { + if(appState.isAuthenticated) { + if (emergencyServicesViewModel.patientHasAdvanceERBalance) { + Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); + } else { + showCommonBottomSheetWithoutHeight( + context, + child: Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.primaryRedColor, borderRadius: 24.h), + child: Padding( + padding: EdgeInsets.all(24.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + "".toText14(), + Utils.buildSvgWithAssets( + icon: AppAssets.cancel_circle_icon, + iconColor: AppColors.whiteColor, + width: 24.h, + height: 24.h, + fit: BoxFit.contain, + ).onPress(() { + Navigator.of(context).pop(); + }), + ], + ), + Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain), + SizedBox(height: 8.h), + LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), + SizedBox(height: 8.h), + LocaleKeys.areYouSureYouWantToMakeERCheckIn.tr().toText14(color: Colors.white, weight: FontWeight.w500), + SizedBox(height: 24.h), + CustomButton( + text: LocaleKeys.confirm.tr(context: context), + onPressed: () async { + Navigator.of(context).pop(); + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingYourERAppointmentStatus.tr()); + await context.read().checkPatientERAdvanceBalance(onSuccess: (dynamic response) { + LoaderBottomSheet.hideLoader(); + context.read().navigateToEROnlineCheckIn(); + }); + }, + backgroundColor: Colors.white, + borderColor: Colors.white, + textColor: AppColors.primaryRedColor, + icon: AppAssets.checkmark_icon, + iconColor: AppColors.primaryRedColor, + ), + SizedBox(height: 8.h), + ], + ), + ), + ), + isFullScreen: false, + isCloseButtonVisible: false, + hasBottomPadding: false, + backgroundColor: AppColors.primaryRedColor, + callBackFunc: () {}, + ); + } + } else { + Navigator.of(context).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.emergencyServices.tr(), + serviceHeader: "ER Check-in, Faster Than Ever. Call ambulance / Rapid Response Team instantly".needTranslation, + serviceDescription: "In a medical emergency? Our ambulances and rapid response teams are on standby 24/7. Plus, quick ER check-in for faster care.".needTranslation, + serviceImage: AppAssets.emergencyService), + ), ); } }), @@ -359,7 +427,7 @@ class EmergencyServicesPage extends StatelessWidget { onCloseClicked: () { context.read().flushPickupInformation(); }, - titleWidget: Transform.flip( + titleWidget: Transform.flip( flipX: emergencyServicesViewModel.isArabic, child: Utils.buildSvgWithAssets( icon: AppAssets.arrow_back, diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index de3235aa..8310e6db 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -26,6 +26,7 @@ import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page. import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart'; import 'package:hmg_patient_app_new/presentation/hmg_services/services_view.dart'; import 'package:hmg_patient_app_new/presentation/home/data/landing_page_data.dart'; +import 'package:hmg_patient_app_new/presentation/home/service_info_page.dart'; import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; import 'package:hmg_patient_app_new/presentation/parking/paking_page.dart'; @@ -54,23 +55,23 @@ class ServicesPage extends StatelessWidget { late final List hmgServices = [ HmgServicesComponentModel(11, LocaleKeys.emergencyServices.tr(), "", AppAssets.emergency_services_icon, bgColor: AppColors.primaryRedColor, true, route: null, onTap: () async { - if (getIt.get().isAuthenticated) { - getIt.get().flushData(); - getIt.get().getTransportationOrders( - showLoader: false, - ); - getIt.get().getRRTOrders( - showLoader: false, - ); + // if (getIt.get().isAuthenticated) { + // getIt.get().flushData(); + // getIt.get().getTransportationOrders( + // showLoader: false, + // ); + // getIt.get().getRRTOrders( + // showLoader: false, + // ); Navigator.of(getIt.get().navigatorKey.currentContext!).push( CustomPageRoute( page: EmergencyServicesPage(), settings: const RouteSettings(name: '/EmergencyServicesPage'), ), ); - } else { - await getIt.get().onLoginPressed(); - } + // } else { + // await getIt.get().onLoginPressed(); + // } }), HmgServicesComponentModel( 11, @@ -85,7 +86,15 @@ class ServicesPage extends StatelessWidget { if (getIt.get().isAuthenticated) { getIt.get().pushPageRoute(AppRoutes.comprehensiveCheckupPage); } else { - await getIt.get().onLoginPressed(); + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.comprehensiveMedicalCheckup.tr(), + serviceHeader: "Complete Health Checkup: Advanced diagnostics, Detailed Health insights".needTranslation, + serviceDescription: "Get detailed insights into your health with our advanced diagnostics. Understand your body better for a healthier future.".needTranslation, + serviceImage: AppAssets.cmcService), + ), + ); } }), HmgServicesComponentModel( @@ -137,7 +146,15 @@ class ServicesPage extends StatelessWidget { if (getIt.get().isAuthenticated) { getIt.get().pushPageRoute(AppRoutes.eReferralPage); } else { - await getIt.get().onLoginPressed(); + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.eReferralServices.tr(), + serviceHeader: "HMG Hospital E-Referral: Streamlined patient referrals".needTranslation, + serviceDescription: "Facilitate seamless patient transfers to HMG with our secure e-referral system. Ensure continuity of care for every patient.".needTranslation, + serviceImage: AppAssets.eReferralService), + ), + ); } }), HmgServicesComponentModel( @@ -147,7 +164,26 @@ class ServicesPage extends StatelessWidget { AppAssets.blood_donation_icon, bgColor: AppColors.bloodDonationCardColor, true, - route: AppRoutes.bloodDonationPage, + route: null, + onTap: () { + if (getIt.get().isAuthenticated) { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: BloodDonationPage(), + ), + ); + } else { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.bloodDonation.tr(), + serviceHeader: "Give Blood, Save Lives. Your donation makes a difference.".needTranslation, + serviceDescription: "Donate blood, empower lives. Your contribution creates hope. Join our blood drive and be a lifeline for those in need. Every drop counts!".needTranslation, + serviceImage: AppAssets.bloodDonationService), + ), + ); + } + } ), HmgServicesComponentModel( 113, @@ -230,7 +266,15 @@ class ServicesPage extends StatelessWidget { if (getIt.get().isAuthenticated) { getIt.get().pushPageRoute(AppRoutes.healthTrackersPage); } else { - await getIt.get().onLoginPressed(); + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.healthTrackers.tr(), + serviceHeader: "HMG Hospital E-Referral: Streamlined patient referrals".needTranslation, + serviceDescription: "Facilitate seamless patient transfers to HMG with our secure e-referral system. Ensure continuity of care for every patient.".needTranslation, + serviceImage: AppAssets.eReferralService), + ), + ); } }, ), @@ -263,7 +307,15 @@ class ServicesPage extends StatelessWidget { }, ); } else { - await getIt.get().onLoginPressed(); + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.waterConsumption.tr(), + serviceHeader: "Stay Hydrated, Stay Healthy. Track your daily water intake with ease.".needTranslation, + serviceDescription: "Quench your thirst, track your health. Effortlessly monitor your daily water intake with our user-friendly app, ensuring optimal hydration and well-being.".needTranslation, + serviceImage: AppAssets.waterConsumptionService), + ), + ); } }, ), @@ -294,8 +346,21 @@ class ServicesPage extends StatelessWidget { true, route: null, onTap: () async { - // if (getIt.get().isAuthenticated) { + if (getIt.get().isAuthenticated) { getIt.get().pushPageRoute(AppRoutes.smartWatches); + } else { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.smartWatches.tr(), + serviceHeader: "HMG Hospital E-Referral: Streamlined patient referrals".needTranslation, + serviceDescription: "Facilitate seamless patient transfers to HMG with our secure e-referral system. Ensure continuity of care for every patient.".needTranslation, + serviceImage: AppAssets.eReferralService), + ), + ); + } + // if (getIt.get().isAuthenticated) { + // getIt.get().pushPageRoute(AppRoutes.smartWatches); // } else { // await getIt.get().onLoginPressed(); // } @@ -368,168 +433,172 @@ class ServicesPage extends StatelessWidget { ), ), SizedBox(height: 24.h), - LocaleKeys.personalServices.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), - SizedBox(height: 16.h), - Row( + getIt.get().isAuthenticated ? Column( children: [ - Expanded( - child: Container( - height: 183.h, - width: 183.h, - padding: EdgeInsets.all(16.w), - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.r, - hasShadow: false, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - spacing: 8.w, - crossAxisAlignment: CrossAxisAlignment.center, + LocaleKeys.personalServices.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), + SizedBox(height: 16.h), + Row( + children: [ + Expanded( + child: Container( + height: 183.h, + width: 183.h, + padding: EdgeInsets.all(16.w), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 20.r, + hasShadow: false, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false), - LocaleKeys.habibWallet.tr().toText14(weight: FontWeight.w600, maxlines: 2).expanded, - Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), + Row( + spacing: 8.w, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Utils.buildSvgWithAssets(icon: AppAssets.wallet, width: 40.w, height: 40.h, applyThemeColor: false), + LocaleKeys.habibWallet.tr().toText14(weight: FontWeight.w600, maxlines: 2).expanded, + Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), + ], + ), + Spacer(), + getIt.get().isAuthenticated + ? Consumer(builder: (context, habibWalletVM, child) { + return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false) + .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h); + }) + : LocaleKeys.loginToViewWalletBalance.tr().toText12(fontWeight: FontWeight.w500, maxLine: 2), + Spacer(), + getIt.get().isAuthenticated + ? CustomButton( + height: 40.h, + icon: AppAssets.recharge_icon, + iconSize: 24.w, + iconColor: AppColors.infoColor, + textColor: AppColors.infoColor, + text: LocaleKeys.recharge.tr(), + borderWidth: 0.w, + fontWeight: FontWeight.w500, + borderColor: Colors.transparent, + backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08), + padding: EdgeInsets.all(8.w), + fontSize: 14.f, + onPressed: () { + Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage())); + }, + ) + : SizedBox.shrink(), ], - ), - Spacer(), - getIt.get().isAuthenticated - ? Consumer(builder: (context, habibWalletVM, child) { - return Utils.getPaymentAmountWithSymbol2(habibWalletVM.habibWalletAmount, isExpanded: false) - .toShimmer2(isShow: habibWalletVM.isWalletAmountLoading, radius: 12.r, width: 80.w, height: 24.h); - }) - : LocaleKeys.loginToViewWalletBalance.tr().toText12(fontWeight: FontWeight.w500, maxLine: 2), - Spacer(), - getIt.get().isAuthenticated - ? CustomButton( - height: 40.h, - icon: AppAssets.recharge_icon, - iconSize: 24.w, - iconColor: AppColors.infoColor, - textColor: AppColors.infoColor, - text: LocaleKeys.recharge.tr(), - borderWidth: 0.w, - fontWeight: FontWeight.w500, - borderColor: Colors.transparent, - backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08), - padding: EdgeInsets.all(8.w), - fontSize: 14.f, - onPressed: () { - Navigator.of(context).push(CustomPageRoute(page: RechargeWalletPage())); - }, - ) - : SizedBox.shrink(), - ], - ).onPress(() async { - if (getIt.get().isAuthenticated) { - Navigator.of(context).push(CustomPageRoute(page: HabibWalletPage())); - } else { - await getIt.get().onLoginPressed(); - } - }), - ), - ), - SizedBox(width: 16.w), - Expanded( - child: Container( - height: 183.h, - width: 183.h, - padding: EdgeInsets.all(16.w), - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 20.r, - hasShadow: false, + ).onPress(() async { + if (getIt.get().isAuthenticated) { + Navigator.of(context).push(CustomPageRoute(page: HabibWalletPage())); + } else { + await getIt.get().onLoginPressed(); + } + }), + ), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - spacing: 8.w, - crossAxisAlignment: CrossAxisAlignment.center, + SizedBox(width: 16.w), + Expanded( + child: Container( + height: 183.h, + width: 183.h, + padding: EdgeInsets.all(16.w), + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 20.r, + hasShadow: false, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h, applyThemeColor: false), - LocaleKeys.medicalFile.tr().toText16(weight: FontWeight.w600, maxlines: 2).expanded, - Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), + Row( + spacing: 8.w, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h, applyThemeColor: false), + LocaleKeys.medicalFile.tr().toText16(weight: FontWeight.w600, maxlines: 2).expanded, + Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), + ], + ), + Spacer(), + getIt.get().isAuthenticated + ? Wrap( + spacing: -12.h, + // runSpacing: 0.h, + children: [ + Utils.buildImgWithAssets( + icon: AppAssets.babyGirlImg, + height: 32.h, + width: 32.w, + border: 1, + fit: BoxFit.contain, + borderRadius: 50.r, + ), + Utils.buildImgWithAssets( + icon: AppAssets.femaleImg, + height: 32.h, + width: 32.w, + border: 1, + borderRadius: 50.r, + fit: BoxFit.contain, + ), + Utils.buildImgWithAssets( + icon: AppAssets.maleImg, + height: 32.h, + width: 32.w, + border: 1, + borderRadius: 50.r, + fit: BoxFit.contain, + ), + ], + ) + : LocaleKeys.loginToViewMedicalFile.tr().toText12(fontWeight: FontWeight.w500, maxLine: 2), + Spacer(), + getIt.get().isAuthenticated + ? CustomButton( + height: 40.h, + icon: AppAssets.add_icon, + iconSize: 24.h, + iconColor: AppColors.primaryRedColor, + textColor: AppColors.primaryRedColor, + text: LocaleKeys.addMember.tr(), + borderWidth: 0.w, + fontWeight: FontWeight.w500, + borderColor: Colors.transparent, + backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.08), + padding: EdgeInsets.all(8.w), + fontSize: 14.f, + onPressed: () { + DialogService dialogService = getIt.get(); + medicalFileViewModel.clearAuthValues(); + dialogService.showAddFamilyFileSheet( + label: LocaleKeys.addFamilyMember.tr(), + message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(), + onVerificationPress: () { + medicalFileViewModel.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms); + }); + }, + ) + : SizedBox.shrink(), ], - ), - Spacer(), - getIt.get().isAuthenticated - ? Wrap( - spacing: -12.h, - // runSpacing: 0.h, - children: [ - Utils.buildImgWithAssets( - icon: AppAssets.babyGirlImg, - height: 32.h, - width: 32.w, - border: 1, - fit: BoxFit.contain, - borderRadius: 50.r, - ), - Utils.buildImgWithAssets( - icon: AppAssets.femaleImg, - height: 32.h, - width: 32.w, - border: 1, - borderRadius: 50.r, - fit: BoxFit.contain, - ), - Utils.buildImgWithAssets( - icon: AppAssets.maleImg, - height: 32.h, - width: 32.w, - border: 1, - borderRadius: 50.r, - fit: BoxFit.contain, - ), - ], - ) - : LocaleKeys.loginToViewMedicalFile.tr().toText12(fontWeight: FontWeight.w500, maxLine: 2), - Spacer(), - getIt.get().isAuthenticated - ? CustomButton( - height: 40.h, - icon: AppAssets.add_icon, - iconSize: 24.h, - iconColor: AppColors.primaryRedColor, - textColor: AppColors.primaryRedColor, - text: LocaleKeys.addMember.tr(), - borderWidth: 0.w, - fontWeight: FontWeight.w500, - borderColor: Colors.transparent, - backgroundColor: AppColors.primaryRedColor.withValues(alpha: 0.08), - padding: EdgeInsets.all(8.w), - fontSize: 14.f, - onPressed: () { - DialogService dialogService = getIt.get(); - medicalFileViewModel.clearAuthValues(); - dialogService.showAddFamilyFileSheet( - label: LocaleKeys.addFamilyMember.tr(), - message: LocaleKeys.pleaseFillBelowFieldToAddNewFamilyMember.tr(), - onVerificationPress: () { - medicalFileViewModel.addFamilyFile(otpTypeEnum: OTPTypeEnum.sms); - }); - }, - ) - : SizedBox.shrink(), - ], - ).onPress(() async { - if (getIt.get().isAuthenticated) { - Navigator.of(context).push( - CustomPageRoute( - page: MedicalFilePage(), - ), - ); - } else { - await getIt.get().onLoginPressed(); - } - }), - ), - ), + ).onPress(() async { + if (getIt.get().isAuthenticated) { + Navigator.of(context).push( + CustomPageRoute( + page: MedicalFilePage(), + ), + ); + } else { + await getIt.get().onLoginPressed(); + } + }), + ), + ), + ], + ).paddingSymmetrical(24.w, 0), ], - ).paddingSymmetrical(24.w, 0), + ) : SizedBox(), SizedBox(height: 24.h), LocaleKeys.healthTools.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), SizedBox(height: 16.h), diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 62707ab4..3109443f 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -349,7 +349,7 @@ class _LandingPageState extends State { ).paddingSymmetrical(24.w, 0.h) : SizedBox.shrink(), appState.isAuthenticated - ? Column( + ? Column( children: [ SizedBox(height: 12.h), Row( @@ -575,66 +575,61 @@ class _LandingPageState extends State { Navigator.of(context).push(CustomPageRoute(page: MedicalFilePage())); }), SizedBox(height: 16.h), - Container( - // height: 121.h, - decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), - child: Column( - children: [ - SizedBox( - height: 92.h + 32.h - 4.h, - child: RawScrollbar( - controller: _horizontalScrollController, - thumbVisibility: true, - radius: Radius.circular(10.0), - thumbColor: AppColors.primaryRedColor, - trackVisibility: true, - trackColor: Color(0xffD9D9D9), - trackBorderColor: Colors.transparent, - trackRadius: Radius.circular(10.0), - padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery - .sizeOf(context) - .width / 2 - 35, right: MediaQuery - .sizeOf(context) - .width / 2 - 35), - child: ListView.separated( - scrollDirection: Axis.horizontal, - itemCount: LandingPageData.getLoggedInServiceCardsList.length, - shrinkWrap: true, - controller: _horizontalScrollController, - padding: EdgeInsets.only(left: 16.h, right: 16.h, top: 16.h, bottom: 12.h), - itemBuilder: (context, index) { - return AnimationConfiguration.staggeredList( - position: index, - duration: const Duration(milliseconds: 1000), - child: SlideAnimation( - horizontalOffset: 100.0, - child: FadeInAnimation( - child: SmallServiceCard( - icon: LandingPageData.getLoggedInServiceCardsList[index].icon, - title: LandingPageData.getLoggedInServiceCardsList[index].title, - subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle, - iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor!, - textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor, - backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor, - isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold, - serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName, + Container( + // height: 121.h, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), + child: Column( + children: [ + SizedBox( + height: 92.h + 32.h - 4.h, + child: RawScrollbar( + controller: _horizontalScrollController, + thumbVisibility: true, + radius: Radius.circular(10.0), + thumbColor: AppColors.primaryRedColor, + trackVisibility: true, + trackColor: Color(0xffD9D9D9), + trackBorderColor: Colors.transparent, + trackRadius: Radius.circular(10.0), + padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery.sizeOf(context).width / 2.5 - 10, right: MediaQuery.sizeOf(context).width / 2.5 - 10), + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemCount: LandingPageData.getLoggedInServiceCardsList.length, + shrinkWrap: true, + controller: _horizontalScrollController, + padding: EdgeInsets.only(left: 0.h, right: 0.h, top: 16.h, bottom: 12.h), + itemBuilder: (context, index) { + return AnimationConfiguration.staggeredList( + position: index, + duration: const Duration(milliseconds: 1000), + child: SlideAnimation( + horizontalOffset: 100.0, + child: FadeInAnimation( + child: SmallServiceCard( + icon: LandingPageData.getLoggedInServiceCardsList[index].icon, + title: LandingPageData.getLoggedInServiceCardsList[index].title, + subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle, + iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor!, + textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor, + backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor, + isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold, + serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName, + ), + ), + ), + ); + }, + separatorBuilder: (BuildContext cxt, int index) => 10.width, + ).paddingSymmetrical(16.h, 0.h), ), ), - ), - ); - }, - separatorBuilder: (BuildContext cxt, int index) => 10.width, - ), - ), - ), - SizedBox(height: 16.h), - ], - ), - ).paddingSymmetrical(24.h, 0.h), - ], - ) - : Container( - // height: 141.h, + SizedBox(height: 16.h), + ], + ), + ).paddingSymmetrical(24.h, 0.h), + ], + ) + : Container( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), child: Column( children: [ @@ -649,14 +644,13 @@ class _LandingPageState extends State { trackColor: Color(0xffD9D9D9), trackBorderColor: Colors.transparent, trackRadius: Radius.circular(10.0), - padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery.sizeOf(context).width / 2 - 35, right: MediaQuery.sizeOf(context).width / 2 - 35), + padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery.sizeOf(context).width / 2.5 - 10, right: MediaQuery.sizeOf(context).width / 2.5 - 10), child: ListView.separated( scrollDirection: Axis.horizontal, itemCount: LandingPageData.getNotLoggedInServiceCardsList.length, shrinkWrap: true, controller: _horizontalScrollController, - padding: EdgeInsets.only(left: 16.h, right: 16.h, top: 16.h, bottom: 12.h), - // padding: EdgeInsets.zero, + padding: EdgeInsets.only(left: 0.h, right: 0.h, top: 16.h, bottom: 12.h), itemBuilder: (context, index) { return AnimationConfiguration.staggeredList( position: index, @@ -679,7 +673,7 @@ class _LandingPageState extends State { ); }, separatorBuilder: (BuildContext cxt, int index) => 0.width, - ), + ).paddingSymmetrical(16.h, 0.h), ), ), SizedBox(height: 16.h), diff --git a/lib/presentation/home/service_info_page.dart b/lib/presentation/home/service_info_page.dart new file mode 100644 index 00000000..5d07593d --- /dev/null +++ b/lib/presentation/home/service_info_page.dart @@ -0,0 +1,74 @@ +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/app_state.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/features/authentication/authentication_view_model.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.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'; + +class ServiceInfoPage extends StatelessWidget { + final String serviceName; + final String serviceHeader; + final String serviceDescription; + final String serviceImage; + + const ServiceInfoPage({required this.serviceName, required this.serviceHeader, required this.serviceDescription, required this.serviceImage, super.key}); + + @override + Widget build(BuildContext context) { + return CollapsingListView( + title: "", + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppCustomChipWidget( + richText: serviceName.toText14(color: AppColors.infoColor, weight: FontWeight.w500), + backgroundColor: AppColors.infoColor.withAlpha(50), + textColor: AppColors.infoColor, + ).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + serviceHeader.toText28(isBold: true, height: 1.4).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + serviceDescription.toText14(weight: FontWeight.w500, color: AppColors.greyTextColor).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 24.h), + CustomButton( + text: LocaleKeys.login.tr(context: context), + onPressed: () { + getIt().onLoginPressed(); + }, + backgroundColor: AppColors.secondaryLightRedColor, + borderColor: AppColors.secondaryLightRedColor, + textColor: AppColors.primaryRedColor, + fontSize: 16.f, + fontWeight: FontWeight.w500, + borderRadius: 12.r, + padding: EdgeInsets.symmetric(horizontal: 10.w), + height: 40.h, + icon: AppAssets.login1, + iconColor: AppColors.primaryRedColor, + iconSize: 18.h, + ).paddingSymmetrical(24.h, 0.h), + SizedBox(height: 36.h), + ClipRRect( + borderRadius: BorderRadius.circular(24.r), + child: Transform.flip( + flipX: getIt.get().isArabic(), + child: Image.asset( + serviceImage, + fit: BoxFit.fitHeight, + width: 520.w, + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/home/widgets/large_service_card.dart b/lib/presentation/home/widgets/large_service_card.dart index b89e58c5..f0145afa 100644 --- a/lib/presentation/home/widgets/large_service_card.dart +++ b/lib/presentation/home/widgets/large_service_card.dart @@ -1,6 +1,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.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'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -10,6 +11,7 @@ import 'package:hmg_patient_app_new/features/book_appointments/book_appointments import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart'; import 'package:hmg_patient_app_new/presentation/home/data/service_card_data.dart'; +import 'package:hmg_patient_app_new/presentation/home/service_info_page.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_procedures_page.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; @@ -135,11 +137,23 @@ class LargeServiceCard extends StatelessWidget { } case "home_health_care": { - Navigator.of(getIt().navigatorKey.currentContext!).push( - CustomPageRoute( - page: HhcProceduresPage(), - ), - ); + if (getIt.get().isAuthenticated) { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: HhcProceduresPage(), + ), + ); + } else { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.homeHealthCare.tr(), + serviceHeader: "Your Health, Elevated. Premium care, delivered to your doorstep.", + serviceDescription: "We bring quality healthcare to your doorstep. Experienced nurses providing compassionate care in the comfort of your home.", + serviceImage: AppAssets.homeHealthCareService), + ), + ); + } } case "pharmacy": { @@ -270,11 +284,23 @@ class FadedLargeServiceCard extends StatelessWidget { } case "home_health_care": { - Navigator.of(getIt().navigatorKey.currentContext!).push( - CustomPageRoute( - page: HhcProceduresPage(), - ), - ); + if (getIt.get().isAuthenticated) { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: HhcProceduresPage(), + ), + ); + } else { + Navigator.of(getIt().navigatorKey.currentContext!).push( + CustomPageRoute( + page: ServiceInfoPage( + serviceName: LocaleKeys.homeHealthCare.tr(), + serviceHeader: "Your Health, Elevated. Premium care, delivered to your doorstep.".needTranslation, + serviceDescription: "We bring quality healthcare to your doorstep. Experienced nurses providing compassionate care in the comfort of your home.".needTranslation, + serviceImage: AppAssets.homeHealthCareService), + ), + ); + } } case "pharmacy": { diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index e65499a1..3e440723 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -473,8 +473,7 @@ class _MedicalFilePageState extends State { ], ); }), - SizedBox(height: 16.h), - + SizedBox(height: 24.h), // TextInputWidget( // labelText: LocaleKeys.search.tr(context: context), // hintText: "Type any record".needTranslation, @@ -489,7 +488,7 @@ class _MedicalFilePageState extends State { // leadingIcon: AppAssets.search_icon, // hintColor: AppColors.textColor, // ).paddingSymmetrical(24.w, 0.0), - SizedBox(height: 16.h), + // SizedBox(height: 16.h), // Using CustomExpandableList CustomExpandableList( expansionMode: ExpansionMode.exactlyOne, diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index cec865b3..fd88c049 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -40,6 +40,7 @@ import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:in_app_review/in_app_review.dart'; class ProfileSettings extends StatefulWidget { const ProfileSettings({super.key}); @@ -49,6 +50,9 @@ class ProfileSettings extends StatefulWidget { } class ProfileSettingsState extends State { + + final InAppReview inAppReview = InAppReview.instance; + @override void initState() { scheduleMicrotask(() { @@ -313,17 +317,23 @@ class ProfileSettingsState extends State { 1.divider, // actionItem(AppAssets.permission, LocaleKeys.permissions.tr(context: context), () {}, trailingLabel: "Location, Camera"), // 1.divider, - actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () { - if (Platform.isAndroid) { - Utils.openWebView( - url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg', - ); + actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () async { + if (await inAppReview.isAvailable()) { + inAppReview.requestReview(); } else { - Utils.openWebView( - url: 'https://itunes.apple.com/app/id733503978', - ); + inAppReview.openStoreListing(appStoreId: '6758851027'); } - }, isExternalLink: true), + // if (Platform.isAndroid) { + // Utils.openWebView( + // url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg', + // ); + // } else { + // Utils.openWebView( + // url: 'https://itunes.apple.com/app/id733503978', + // ); + // } + // }, isExternalLink: true), + }), 1.divider, actionItem(AppAssets.privacy_terms, LocaleKeys.privacyPolicy.tr(context: context), () { Utils.openWebView( @@ -339,12 +349,12 @@ class ProfileSettingsState extends State { ], ), ), - CustomButton( - height: 56.h, - icon: AppAssets.minus, - text: LocaleKeys.deactivateAccount.tr(context: context), - onPressed: () {}, - ).paddingAll(24.w), + // CustomButton( + // height: 56.h, + // icon: AppAssets.minus, + // text: LocaleKeys.deactivateAccount.tr(context: context), + // onPressed: () {}, + // ).paddingAll(24.w), ], ); }, @@ -391,7 +401,10 @@ class ProfileSettingsState extends State { Utils.buildSvgWithAssets(icon: icon, iconColor: AppColors.greyTextColor), label.toText14(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).expanded, if (trailingLabel.isNotEmpty) - trailingLabel.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).toShimmer2(isShow: isShowLoading), + ConstrainedBox( + constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.35), + child: trailingLabel.toText14(color: AppColors.greyTextColor, weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).toShimmer2(isShow: isShowLoading), + ), switchValue != null ? Switch( value: switchValue, diff --git a/pubspec.yaml b/pubspec.yaml index e0f8c0e6..3b112673 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -99,6 +99,8 @@ dependencies: scrollable_positioned_list: ^0.3.8 + in_app_review: ^2.0.11 + dev_dependencies: flutter_test: sdk: flutter