pull/204/head
haroon amjad 2 days ago
parent fbb2570d8e
commit 837a934d0d

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 KiB

@ -359,6 +359,11 @@ class AppAssets {
static const String homeHealthCareService = '$pngBasePath/home_health_care.png'; static const String homeHealthCareService = '$pngBasePath/home_health_care.png';
static const String pharmacyService = '$pngBasePath/pharmacy_service.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 maleImg = '$pngBasePath/male_img.png';
static const String femaleImg = '$pngBasePath/female_img.png'; static const String femaleImg = '$pngBasePath/female_img.png';

@ -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/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/find_us_page.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/live_chat_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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -80,15 +82,23 @@ class ContactUs extends StatelessWidget {
LocaleKeys.liveChat.tr(), LocaleKeys.liveChat.tr(),
LocaleKeys.liveChatWithHMG.tr(), LocaleKeys.liveChatWithHMG.tr(),
).onPress(() { ).onPress(() {
locationUtils.getCurrentLocation(onSuccess: (value) { if (getIt.get<AppState>().isAuthenticated) {
contactUsViewModel.getLiveChatProjectsList();
Navigator.pop(context);
Navigator.of(context).push( Navigator.of(context).push(
CustomPageRoute( CustomPageRoute(
page: LiveChatPage(), page: LiveChatPage(),
), ),
); );
}); } else {
Navigator.of(getIt<NavigationService>().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),
),
);
}
}), }),
], ],
); );

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.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/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/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/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/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/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/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/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.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/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:lottie/lottie.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class EmergencyServicesPage extends StatelessWidget { class EmergencyServicesPage extends StatefulWidget {
EmergencyServicesPage({super.key}); EmergencyServicesPage({super.key});
@override
State<EmergencyServicesPage> createState() => _EmergencyServicesPageState();
}
class _EmergencyServicesPageState extends State<EmergencyServicesPage> {
late EmergencyServicesViewModel emergencyServicesViewModel; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
emergencyServicesViewModel = Provider.of<EmergencyServicesViewModel>(context, listen: false); emergencyServicesViewModel = Provider.of<EmergencyServicesViewModel>(context, listen: false);
appState = getIt.get<AppState>();
return CollapsingListView( return CollapsingListView(
title: LocaleKeys.emergencyServices.tr(), title: LocaleKeys.emergencyServices.tr(),
history: () { history: appState.isAuthenticated
? () {
emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL); emergencyServicesViewModel.changeOrderDisplayItems(OrderDislpay.ALL);
Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up)); Navigator.of(context).push(CustomPageRoute(page: ErHistoryListing(), direction: AxisDirection.up));
}, }
: null,
child: Padding( child: Padding(
padding: EdgeInsets.all(24.h), padding: EdgeInsets.all(24.h),
child: Column( child: Column(
@ -61,8 +87,7 @@ class EmergencyServicesPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.callAmbulance.tr().toText16(isBold: true, color: AppColors.blackColor), LocaleKeys.callAmbulance.tr().toText16(isBold: true, color: AppColors.blackColor),
LocaleKeys.requestAmbulanceInEmergency.tr() LocaleKeys.requestAmbulanceInEmergency.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -70,6 +95,7 @@ class EmergencyServicesPage extends StatelessWidget {
Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h),
], ],
).onPress(() { ).onPress(() {
if(appState.isAuthenticated) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Container( child: Container(
@ -97,13 +123,11 @@ class EmergencyServicesPage extends StatelessWidget {
}), }),
], ],
), ),
Lottie.asset(AppAnimations.ambulanceAlert, Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain),
repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.confirmation.tr().toText28(color: Colors.white, isBold: true), LocaleKeys.confirmation.tr().toText28(color: Colors.white, isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.areYouSureYouWantToCallAmbulance.tr() LocaleKeys.areYouSureYouWantToCallAmbulance.tr().toText14(color: Colors.white, weight: FontWeight.w500),
.toText14(color: Colors.white, weight: FontWeight.w500),
SizedBox(height: 24.h), SizedBox(height: 24.h),
CustomButton( CustomButton(
text: LocaleKeys.confirm.tr(context: context), text: LocaleKeys.confirm.tr(context: context),
@ -129,6 +153,17 @@ class EmergencyServicesPage extends StatelessWidget {
backgroundColor: AppColors.primaryRedColor, backgroundColor: AppColors.primaryRedColor,
callBackFunc: () {}, 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), SizedBox(height: 16.h),
@ -148,8 +183,7 @@ class EmergencyServicesPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.nearester.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), LocaleKeys.nearester.tr(context: context).toText16(isBold: true, color: AppColors.blackColor),
LocaleKeys.getDetailsOfNearestBranch.tr() LocaleKeys.getDetailsOfNearestBranch.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -177,8 +211,7 @@ class EmergencyServicesPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.rapidResponseTeam.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), LocaleKeys.rapidResponseTeam.tr(context: context).toText16(isBold: true, color: AppColors.blackColor),
"Comprehensive medical service for all sorts of urgent and stable cases" "Comprehensive medical service for all sorts of urgent and stable cases".toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -186,6 +219,7 @@ class EmergencyServicesPage extends StatelessWidget {
Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h),
], ],
).onPress(() { ).onPress(() {
if(appState.isAuthenticated) {
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
child: Container( child: Container(
@ -198,18 +232,31 @@ class EmergencyServicesPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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), Lottie.asset(AppAnimations.ambulanceAlert, repeat: false, reverse: false, frameRate: FrameRate(60), width: 120.h, height: 120.h, fit: BoxFit.contain),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true), LocaleKeys.confirm.tr().toText28(color: Colors.white, isBold: true),
SizedBox(height: 8.h), SizedBox(height: 8.h),
LocaleKeys.areYouSureYouWantToCallRRT.tr() LocaleKeys.areYouSureYouWantToCallRRT.tr().toText14(color: Colors.white, weight: FontWeight.w500),
.toText14(color: Colors.white, weight: FontWeight.w500),
SizedBox(height: 24.h), SizedBox(height: 24.h),
CustomButton( CustomButton(
text: LocaleKeys.confirm.tr(context: context), text: LocaleKeys.confirm.tr(context: context),
onPressed: () async { onPressed: () async {
Navigator.of(context).pop(); Navigator.of(context).pop();
LoaderBottomSheet.showLoader(); LoaderBottomSheet.showLoader();
emergencyServicesViewModel.clearRRTData(); emergencyServicesViewModel.clearRRTData();
await emergencyServicesViewModel.getRRTProcedures(onSuccess: (val) { await emergencyServicesViewModel.getRRTProcedures(onSuccess: (val) {
@ -224,7 +271,6 @@ class EmergencyServicesPage extends StatelessWidget {
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
).onPress(() { ).onPress(() {
Navigator.pop(context); Navigator.pop(context);
}), }),
// title: "Rapid Response Team (RRT)".needTranslation, // title: "Rapid Response Team (RRT)".needTranslation,
@ -257,6 +303,17 @@ class EmergencyServicesPage extends StatelessWidget {
context.read<EmergencyServicesViewModel>().setTermsAndConditions(false); context.read<EmergencyServicesViewModel>().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), SizedBox(height: 16.h),
@ -276,8 +333,7 @@ class EmergencyServicesPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LocaleKeys.emergencyCheckIn.tr(context: context).toText16(isBold: true, color: AppColors.blackColor), LocaleKeys.emergencyCheckIn.tr(context: context).toText16(isBold: true, color: AppColors.blackColor),
LocaleKeys.priorERCheckInToSkipLine.tr() LocaleKeys.priorERCheckInToSkipLine.tr().toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
.toText12(color: AppColors.greyTextColor, fontWeight: FontWeight.w500),
], ],
), ),
), ),
@ -285,6 +341,7 @@ class EmergencyServicesPage extends StatelessWidget {
Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h), Utils.buildSvgWithAssets(icon: AppAssets.forward_chevron_icon, width: 13.h, height: 13.h),
], ],
).onPress(() { ).onPress(() {
if(appState.isAuthenticated) {
if (emergencyServicesViewModel.patientHasAdvanceERBalance) { if (emergencyServicesViewModel.patientHasAdvanceERBalance) {
Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome())); Navigator.of(context).push(CustomPageRoute(page: ErOnlineCheckinHome()));
} else { } else {
@ -346,6 +403,17 @@ class EmergencyServicesPage extends StatelessWidget {
callBackFunc: () {}, 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),
),
);
}
}), }),
), ),
], ],

@ -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/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/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/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/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/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/presentation/parking/paking_page.dart'; import 'package:hmg_patient_app_new/presentation/parking/paking_page.dart';
@ -54,23 +55,23 @@ class ServicesPage extends StatelessWidget {
late final List<HmgServicesComponentModel> hmgServices = [ late final List<HmgServicesComponentModel> hmgServices = [
HmgServicesComponentModel(11, LocaleKeys.emergencyServices.tr(), "", AppAssets.emergency_services_icon, bgColor: AppColors.primaryRedColor, true, route: null, onTap: () async { HmgServicesComponentModel(11, LocaleKeys.emergencyServices.tr(), "", AppAssets.emergency_services_icon, bgColor: AppColors.primaryRedColor, true, route: null, onTap: () async {
if (getIt.get<AppState>().isAuthenticated) { // if (getIt.get<AppState>().isAuthenticated) {
getIt.get<EmergencyServicesViewModel>().flushData(); // getIt.get<EmergencyServicesViewModel>().flushData();
getIt.get<EmergencyServicesViewModel>().getTransportationOrders( // getIt.get<EmergencyServicesViewModel>().getTransportationOrders(
showLoader: false, // showLoader: false,
); // );
getIt.get<EmergencyServicesViewModel>().getRRTOrders( // getIt.get<EmergencyServicesViewModel>().getRRTOrders(
showLoader: false, // showLoader: false,
); // );
Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push( Navigator.of(getIt.get<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute( CustomPageRoute(
page: EmergencyServicesPage(), page: EmergencyServicesPage(),
settings: const RouteSettings(name: '/EmergencyServicesPage'), settings: const RouteSettings(name: '/EmergencyServicesPage'),
), ),
); );
} else { // } else {
await getIt.get<AuthenticationViewModel>().onLoginPressed(); // await getIt.get<AuthenticationViewModel>().onLoginPressed();
} // }
}), }),
HmgServicesComponentModel( HmgServicesComponentModel(
11, 11,
@ -85,7 +86,15 @@ class ServicesPage extends StatelessWidget {
if (getIt.get<AppState>().isAuthenticated) { if (getIt.get<AppState>().isAuthenticated) {
getIt.get<NavigationService>().pushPageRoute(AppRoutes.comprehensiveCheckupPage); getIt.get<NavigationService>().pushPageRoute(AppRoutes.comprehensiveCheckupPage);
} else { } else {
await getIt.get<AuthenticationViewModel>().onLoginPressed(); Navigator.of(getIt<NavigationService>().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( HmgServicesComponentModel(
@ -137,7 +146,15 @@ class ServicesPage extends StatelessWidget {
if (getIt.get<AppState>().isAuthenticated) { if (getIt.get<AppState>().isAuthenticated) {
getIt.get<NavigationService>().pushPageRoute(AppRoutes.eReferralPage); getIt.get<NavigationService>().pushPageRoute(AppRoutes.eReferralPage);
} else { } else {
await getIt.get<AuthenticationViewModel>().onLoginPressed(); Navigator.of(getIt<NavigationService>().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( HmgServicesComponentModel(
@ -147,7 +164,26 @@ class ServicesPage extends StatelessWidget {
AppAssets.blood_donation_icon, AppAssets.blood_donation_icon,
bgColor: AppColors.bloodDonationCardColor, bgColor: AppColors.bloodDonationCardColor,
true, true,
route: AppRoutes.bloodDonationPage, route: null,
onTap: () {
if (getIt.get<AppState>().isAuthenticated) {
Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: BloodDonationPage(),
),
);
} else {
Navigator.of(getIt<NavigationService>().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( HmgServicesComponentModel(
113, 113,
@ -230,7 +266,15 @@ class ServicesPage extends StatelessWidget {
if (getIt.get<AppState>().isAuthenticated) { if (getIt.get<AppState>().isAuthenticated) {
getIt.get<NavigationService>().pushPageRoute(AppRoutes.healthTrackersPage); getIt.get<NavigationService>().pushPageRoute(AppRoutes.healthTrackersPage);
} else { } else {
await getIt.get<AuthenticationViewModel>().onLoginPressed(); Navigator.of(getIt<NavigationService>().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 { } else {
await getIt.get<AuthenticationViewModel>().onLoginPressed(); Navigator.of(getIt<NavigationService>().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, true,
route: null, route: null,
onTap: () async { onTap: () async {
// if (getIt.get<AppState>().isAuthenticated) { if (getIt.get<AppState>().isAuthenticated) {
getIt.get<NavigationService>().pushPageRoute(AppRoutes.smartWatches); getIt.get<NavigationService>().pushPageRoute(AppRoutes.smartWatches);
} else {
Navigator.of(getIt<NavigationService>().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<AppState>().isAuthenticated) {
// getIt.get<NavigationService>().pushPageRoute(AppRoutes.smartWatches);
// } else { // } else {
// await getIt.get<AuthenticationViewModel>().onLoginPressed(); // await getIt.get<AuthenticationViewModel>().onLoginPressed();
// } // }
@ -368,6 +433,8 @@ class ServicesPage extends StatelessWidget {
), ),
), ),
SizedBox(height: 24.h), SizedBox(height: 24.h),
getIt.get<AppState>().isAuthenticated ? Column(
children: [
LocaleKeys.personalServices.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), LocaleKeys.personalServices.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h), SizedBox(height: 16.h),
Row( Row(
@ -530,6 +597,8 @@ class ServicesPage extends StatelessWidget {
), ),
], ],
).paddingSymmetrical(24.w, 0), ).paddingSymmetrical(24.w, 0),
],
) : SizedBox(),
SizedBox(height: 24.h), SizedBox(height: 24.h),
LocaleKeys.healthTools.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0), LocaleKeys.healthTools.tr().toText18(weight: FontWeight.w600).paddingSymmetrical(24.w, 0),
SizedBox(height: 16.h), SizedBox(height: 16.h),

@ -591,17 +591,13 @@ class _LandingPageState extends State<LandingPage> {
trackColor: Color(0xffD9D9D9), trackColor: Color(0xffD9D9D9),
trackBorderColor: Colors.transparent, trackBorderColor: Colors.transparent,
trackRadius: Radius.circular(10.0), trackRadius: Radius.circular(10.0),
padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery padding: EdgeInsets.only(top: 92.h + 32.h, left: MediaQuery.sizeOf(context).width / 2.5 - 10, right: MediaQuery.sizeOf(context).width / 2.5 - 10),
.sizeOf(context)
.width / 2 - 35, right: MediaQuery
.sizeOf(context)
.width / 2 - 35),
child: ListView.separated( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getLoggedInServiceCardsList.length, itemCount: LandingPageData.getLoggedInServiceCardsList.length,
shrinkWrap: true, shrinkWrap: true,
controller: _horizontalScrollController, controller: _horizontalScrollController,
padding: EdgeInsets.only(left: 16.h, right: 16.h, top: 16.h, bottom: 12.h), padding: EdgeInsets.only(left: 0.h, right: 0.h, top: 16.h, bottom: 12.h),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( return AnimationConfiguration.staggeredList(
position: index, position: index,
@ -624,7 +620,7 @@ class _LandingPageState extends State<LandingPage> {
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 10.width, separatorBuilder: (BuildContext cxt, int index) => 10.width,
), ).paddingSymmetrical(16.h, 0.h),
), ),
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),
@ -634,7 +630,6 @@ class _LandingPageState extends State<LandingPage> {
], ],
) )
: Container( : Container(
// height: 141.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r),
child: Column( child: Column(
children: [ children: [
@ -649,14 +644,13 @@ class _LandingPageState extends State<LandingPage> {
trackColor: Color(0xffD9D9D9), trackColor: Color(0xffD9D9D9),
trackBorderColor: Colors.transparent, trackBorderColor: Colors.transparent,
trackRadius: Radius.circular(10.0), 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( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: LandingPageData.getNotLoggedInServiceCardsList.length, itemCount: LandingPageData.getNotLoggedInServiceCardsList.length,
shrinkWrap: true, shrinkWrap: true,
controller: _horizontalScrollController, controller: _horizontalScrollController,
padding: EdgeInsets.only(left: 16.h, right: 16.h, top: 16.h, bottom: 12.h), padding: EdgeInsets.only(left: 0.h, right: 0.h, top: 16.h, bottom: 12.h),
// padding: EdgeInsets.zero,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AnimationConfiguration.staggeredList( return AnimationConfiguration.staggeredList(
position: index, position: index,
@ -679,7 +673,7 @@ class _LandingPageState extends State<LandingPage> {
); );
}, },
separatorBuilder: (BuildContext cxt, int index) => 0.width, separatorBuilder: (BuildContext cxt, int index) => 0.width,
), ).paddingSymmetrical(16.h, 0.h),
), ),
), ),
SizedBox(height: 16.h), SizedBox(height: 16.h),

@ -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<AuthenticationViewModel>().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<AppState>().isArabic(),
child: Image.asset(
serviceImage,
fit: BoxFit.fitHeight,
width: 520.w,
),
),
),
],
),
);
}
}

@ -1,6 +1,7 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/api_consts.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/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.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/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/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/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/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/presentation/home_health_care/hhc_procedures_page.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
@ -135,11 +137,23 @@ class LargeServiceCard extends StatelessWidget {
} }
case "home_health_care": case "home_health_care":
{ {
if (getIt.get<AppState>().isAuthenticated) {
Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push( Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute( CustomPageRoute(
page: HhcProceduresPage(), page: HhcProceduresPage(),
), ),
); );
} else {
Navigator.of(getIt<NavigationService>().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": case "pharmacy":
{ {
@ -270,11 +284,23 @@ class FadedLargeServiceCard extends StatelessWidget {
} }
case "home_health_care": case "home_health_care":
{ {
if (getIt.get<AppState>().isAuthenticated) {
Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push( Navigator.of(getIt<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute( CustomPageRoute(
page: HhcProceduresPage(), page: HhcProceduresPage(),
), ),
); );
} else {
Navigator.of(getIt<NavigationService>().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": case "pharmacy":
{ {

@ -473,8 +473,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
], ],
); );
}), }),
SizedBox(height: 16.h), SizedBox(height: 24.h),
// TextInputWidget( // TextInputWidget(
// labelText: LocaleKeys.search.tr(context: context), // labelText: LocaleKeys.search.tr(context: context),
// hintText: "Type any record".needTranslation, // hintText: "Type any record".needTranslation,
@ -489,7 +488,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
// leadingIcon: AppAssets.search_icon, // leadingIcon: AppAssets.search_icon,
// hintColor: AppColors.textColor, // hintColor: AppColors.textColor,
// ).paddingSymmetrical(24.w, 0.0), // ).paddingSymmetrical(24.w, 0.0),
SizedBox(height: 16.h), // SizedBox(height: 16.h),
// Using CustomExpandableList // Using CustomExpandableList
CustomExpandableList( CustomExpandableList(
expansionMode: ExpansionMode.exactlyOne, expansionMode: ExpansionMode.exactlyOne,

@ -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:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:in_app_review/in_app_review.dart';
class ProfileSettings extends StatefulWidget { class ProfileSettings extends StatefulWidget {
const ProfileSettings({super.key}); const ProfileSettings({super.key});
@ -49,6 +50,9 @@ class ProfileSettings extends StatefulWidget {
} }
class ProfileSettingsState extends State<ProfileSettings> { class ProfileSettingsState extends State<ProfileSettings> {
final InAppReview inAppReview = InAppReview.instance;
@override @override
void initState() { void initState() {
scheduleMicrotask(() { scheduleMicrotask(() {
@ -313,17 +317,23 @@ class ProfileSettingsState extends State<ProfileSettings> {
1.divider, 1.divider,
// actionItem(AppAssets.permission, LocaleKeys.permissions.tr(context: context), () {}, trailingLabel: "Location, Camera"), // actionItem(AppAssets.permission, LocaleKeys.permissions.tr(context: context), () {}, trailingLabel: "Location, Camera"),
// 1.divider, // 1.divider,
actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () { actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () async {
if (Platform.isAndroid) { if (await inAppReview.isAvailable()) {
Utils.openWebView( inAppReview.requestReview();
url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg',
);
} else { } else {
Utils.openWebView( inAppReview.openStoreListing(appStoreId: '6758851027');
url: 'https://itunes.apple.com/app/id733503978',
);
} }
}, 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, 1.divider,
actionItem(AppAssets.privacy_terms, LocaleKeys.privacyPolicy.tr(context: context), () { actionItem(AppAssets.privacy_terms, LocaleKeys.privacyPolicy.tr(context: context), () {
Utils.openWebView( Utils.openWebView(
@ -339,12 +349,12 @@ class ProfileSettingsState extends State<ProfileSettings> {
], ],
), ),
), ),
CustomButton( // CustomButton(
height: 56.h, // height: 56.h,
icon: AppAssets.minus, // icon: AppAssets.minus,
text: LocaleKeys.deactivateAccount.tr(context: context), // text: LocaleKeys.deactivateAccount.tr(context: context),
onPressed: () {}, // onPressed: () {},
).paddingAll(24.w), // ).paddingAll(24.w),
], ],
); );
}, },
@ -391,7 +401,10 @@ class ProfileSettingsState extends State<ProfileSettings> {
Utils.buildSvgWithAssets(icon: icon, iconColor: AppColors.greyTextColor), Utils.buildSvgWithAssets(icon: icon, iconColor: AppColors.greyTextColor),
label.toText14(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).expanded, label.toText14(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1).expanded,
if (trailingLabel.isNotEmpty) 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 switchValue != null
? Switch( ? Switch(
value: switchValue, value: switchValue,

@ -99,6 +99,8 @@ dependencies:
scrollable_positioned_list: ^0.3.8 scrollable_positioned_list: ^0.3.8
in_app_review: ^2.0.11
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save