import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter_staggered_animations/flutter_staggered_animations.dart ' ;
import ' package:get_it/get_it.dart ' ;
import ' package:hmg_patient_app_new/core/app_assets.dart ' ;
import ' package:hmg_patient_app_new/core/app_export.dart ' ;
import ' package:hmg_patient_app_new/core/app_state.dart ' ;
import ' package:hmg_patient_app_new/core/enums.dart ' ;
import ' package:hmg_patient_app_new/core/utils/utils.dart ' ;
import ' package:hmg_patient_app_new/extensions/route_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/string_extensions.dart ' ;
import ' package:hmg_patient_app_new/extensions/widget_extensions.dart ' ;
import ' package:hmg_patient_app_new/features/authentication/authentication_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/blood_donation/blood_donation_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/emergency_services/emergency_services_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/hmg_services/models/ui_models/hmg_services_component_model.dart ' ;
import ' package:hmg_patient_app_new/features/hospital/hospital_selection_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart ' ;
import ' package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart ' ;
import ' package:hmg_patient_app_new/generated/locale_keys.g.dart ' ;
import ' package:hmg_patient_app_new/presentation/blood_donation/blood_donation_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/contact_us/contact_us.dart ' ;
import ' package:hmg_patient_app_new/presentation/emergency_services/emergency_services_page.dart ' ;
import ' package:hmg_patient_app_new/presentation/habib_wallet/habib_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/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 ' ;
import ' package:hmg_patient_app_new/presentation/servicesPriceList/services_price_list_page.dart ' ;
import ' package:hmg_patient_app_new/services/dialog_service.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/appbar/collapsing_list_view.dart ' ;
import ' package:hmg_patient_app_new/widgets/buttons/custom_button.dart ' ;
import ' package:hmg_patient_app_new/widgets/common_bottom_sheet.dart ' ;
import ' package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart ' ;
import ' package:hmg_patient_app_new/widgets/routes/custom_page_route.dart ' ;
import ' package:provider/provider.dart ' ;
import ' ../../core/dependencies.dart ' show getIt ;
import ' ../../features/qr_parking/qr_parking_view_model.dart ' ;
import ' ../emergency_services/call_ambulance/widgets/HospitalBottomSheetBody.dart ' ;
class ServicesPage extends StatelessWidget {
bool showBackIcon ;
ServicesPage ( { super . key , this . showBackIcon = true } ) ;
late BloodDonationViewModel bloodDonationViewModel ;
late MedicalFileViewModel medicalFileViewModel ;
late final List < HmgServicesComponentModel > hmgServices = [
HmgServicesComponentModel ( 11 , LocaleKeys . emergencyServices . tr ( ) , " " , AppAssets . emergency_services_icon , bgColor: AppColors . primaryRedColor , true , route: null , onTap: ( ) async {
// if (getIt.get<AppState>().isAuthenticated) {
// getIt.get<EmergencyServicesViewModel>().flushData();
// getIt.get<EmergencyServicesViewModel>().getTransportationOrders(
// showLoader: false,
// );
// getIt.get<EmergencyServicesViewModel>().getRRTOrders(
// showLoader: false,
// );
Navigator . of ( getIt . get < NavigationService > ( ) . navigatorKey . currentContext ! ) . push (
CustomPageRoute (
page: EmergencyServicesPage ( ) ,
settings: const RouteSettings ( name: ' /EmergencyServicesPage ' ) ,
) ,
) ;
// } else {
// await getIt.get<AuthenticationViewModel>().onLoginPressed();
// }
} ) ,
HmgServicesComponentModel (
11 ,
LocaleKeys . bookAppointment . tr ( ) ,
" " ,
AppAssets . appointment_calendar_icon ,
bgColor: AppColors . bookAppointment ,
true ,
route: AppRoutes . bookAppointmentPage ,
) ,
HmgServicesComponentModel ( 5 , LocaleKeys . completeCheckup . tr ( ) , " " , AppAssets . comprehensiveCheckup , bgColor: AppColors . bgGreenColor , true , route: null , onTap: ( ) async {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
getIt . get < NavigationService > ( ) . pushPageRoute ( AppRoutes . comprehensiveCheckupPage ) ;
} else {
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 (
11 ,
LocaleKeys . indoorNavigation . tr ( ) ,
" " ,
AppAssets . indoor_nav_icon ,
bgColor: Color ( 0xff45A2F8 ) ,
true ,
route: null ,
onTap: ( ) {
showCommonBottomSheetWithoutHeight (
title: LocaleKeys . selectHospital . tr ( ) ,
GetIt . instance < NavigationService > ( ) . navigatorKey . currentContext ! ,
child: ChangeNotifierProvider (
create: ( context ) = > HospitalSelectionBottomSheetViewModel ( getIt ( ) ) ,
child: Consumer < HospitalSelectionBottomSheetViewModel > (
builder: ( _ , vm , __ ) = > HospitalBottomSheetBody (
searchText: vm . searchController ,
displayList: vm . displayList ,
onFacilityClicked: ( value ) {
vm . setSelectedFacility ( value ) ;
vm . getDisplayList ( ) ;
} ,
onHospitalClicked: ( hospital ) {
Navigator . pop ( GetIt . instance < NavigationService > ( ) . navigatorKey . currentContext ! ) ;
vm . openPenguin ( hospital ) ;
} ,
onHospitalSearch: ( value ) {
vm . searchHospitals ( value ? ? " " ) ;
} ,
selectedFacility: vm . selectedFacility ,
hmcCount: vm . hmcCount ,
hmgCount: vm . hmgCount ,
) ,
) ,
) ,
isFullScreen: false ,
isCloseButtonVisible: true ,
hasBottomPadding: false ,
backgroundColor: AppColors . bottomSheetBgColor ,
callBackFunc: ( ) {
GetIt . instance < NavigationService > ( ) . navigatorKey . currentContext ! . read < EmergencyServicesViewModel > ( ) . clearSearchText ( ) ;
} ,
) ;
} ,
) ,
HmgServicesComponentModel ( 11 , LocaleKeys . eReferralServices . tr ( ) , " " , AppAssets . eReferral , bgColor: AppColors . eReferralCardColor , true , route: null , onTap: ( ) async {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
getIt . get < NavigationService > ( ) . pushPageRoute ( AppRoutes . eReferralPage ) ;
} else {
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 (
3 ,
LocaleKeys . bloodDonation . tr ( context: getIt . get < NavigationService > ( ) . navigatorKey . currentContext ! ) ,
" " . needTranslation ,
AppAssets . blood_donation_icon ,
bgColor: AppColors . bloodDonationCardColor ,
true ,
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 (
113 ,
LocaleKeys . servicePriceList . tr ( context: getIt . get < NavigationService > ( ) . navigatorKey . currentContext ! ) ,
" " . needTranslation ,
AppAssets . saudi_riyal_icon ,
bgColor: AppColors . textColor ,
false ,
route: null ,
onTap: ( ) {
Navigator . of ( getIt . get < NavigationService > ( ) . navigatorKey . currentContext ! ) . push (
CustomPageRoute ( page: ServicesPriceListPage ( ) ) ,
) ;
} ,
)
// HmgServicesComponentModel(
// 3,
// "My Child Vaccine".needTranslation,
// "".needTranslation,
// AppAssets.my_child_vaccine_icon,
// bgColor: AppColors.myChildVaccineCardColor,
// true,
// route: AppRoutes.myChildVaccine,
// ),
// HmgServicesComponentModel(
// 11,
// "Covid 19 Test".needTranslation,
// "".needTranslation,
// AppAssets.covid19icon,
// bgColor: AppColors.covid29Color,
// true,
// route: AppRoutes.covid19Test,
// ),
// HmgServicesComponentModel(
// 11,
// "Vital Sign".needTranslation,
// "".needTranslation,
// AppAssets.covid19icon,
// bgColor: AppColors.covid29Color,
// true,
// route: AppRoutes.vitalSign,
// )
// HmgServicesComponentModel(
// 3,
// "Home Health Care".needTranslation,
// "".needTranslation,
// AppAssets.homeBottom,
// bgColor: AppColors.primaryRedColor,
// true,
// route: AppRoutes.homeHealthCarePage,
// ),
// HmgServicesComponentModel(
// 11,
// "Virtual Tour".needTranslation,
// "".needTranslation,
// AppAssets.my_address,
// bgColor: AppColors.quickLoginColor,
// true,
// route: null,
// onTap:(){
// Utils.openWebView(
// url: 'https://hmgwebservices.com/vt_mobile/html/index.html',
// );
// },
// )
] ;
late final List < HmgServicesComponentModel > hmgHealthToolServices = [
HmgServicesComponentModel (
11 ,
LocaleKeys . healthTrackers . tr ( ) ,
" " ,
AppAssets . general_health ,
bgColor: AppColors . whiteColor ,
true ,
route: null ,
onTap: ( ) async {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
getIt . get < NavigationService > ( ) . pushPageRoute ( AppRoutes . healthTrackersPage ) ;
} else {
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 ) ,
) ,
) ;
}
} ,
) ,
HmgServicesComponentModel (
11 ,
LocaleKeys . dailyWaterMonitor . tr ( ) ,
" " ,
AppAssets . daily_water_monitor_icon ,
bgColor: AppColors . whiteColor ,
true ,
route: null , // Set to null since we handle navigation in onTap
onTap: ( ) async {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . fetchingYourWaterIntakeDetails . tr ( ) ) ;
final waterMonitorVM = getIt . get < WaterMonitorViewModel > ( ) ;
final context = getIt . get < NavigationService > ( ) . navigatorKey . currentContext ! ;
await waterMonitorVM . fetchUserDetailsForMonitoring (
onSuccess: ( userDetail ) {
LoaderBottomSheet . hideLoader ( ) ;
if ( userDetail = = null ) {
waterMonitorVM . populateFromAuthenticatedUser ( ) ;
context . navigateWithName ( AppRoutes . waterMonitorSettingsPage ) ;
} else {
context . navigateWithName ( AppRoutes . waterConsumptionPage ) ;
}
} ,
onError: ( error ) {
LoaderBottomSheet . hideLoader ( ) ;
context . navigateWithName ( AppRoutes . waterConsumptionPage ) ;
} ,
) ;
} else {
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 ) ,
) ,
) ;
}
} ,
) ,
HmgServicesComponentModel (
11 ,
LocaleKeys . healthCalculatorsServices . tr ( ) ,
" " ,
AppAssets . health_calculators_services_icon ,
bgColor: AppColors . whiteColor ,
true ,
route: AppRoutes . healthCalculatorsPage ,
) ,
HmgServicesComponentModel (
5 ,
LocaleKeys . healthConvertersServices . tr ( ) ,
" " ,
AppAssets . health_converters_icon ,
bgColor: AppColors . whiteColor ,
true ,
route: AppRoutes . healthConvertersPage ,
) ,
HmgServicesComponentModel (
11 ,
LocaleKeys . smartWatchesServices . tr ( ) ,
" " ,
AppAssets . smartwatch_icon ,
bgColor: AppColors . whiteColor ,
true ,
route: null ,
onTap: ( ) async {
if ( getIt . get < AppState > ( ) . isAuthenticated ) {
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 {
// await getIt.get<AuthenticationViewModel>().onLoginPressed();
// }
} ,
// route: AppRoutes.huaweiHealthExample,
) ,
] ;
@ override
Widget build ( BuildContext context ) {
bloodDonationViewModel = Provider . of < BloodDonationViewModel > ( context ) ;
medicalFileViewModel = Provider . of < MedicalFileViewModel > ( context ) ;
hmgServices . removeWhere ( ( element ) = > Utils . havePrivilege ( element . action ) = = false ) ;
return Scaffold (
backgroundColor: AppColors . bgScaffoldColor ,
body: CollapsingListView (
title: LocaleKeys . exploreServices . tr ( ) ,
isLeading: showBackIcon ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
SizedBox ( height: 16. h ) ,
LocaleKeys . medicalAndCareServices . tr ( ) . toText18 ( weight: FontWeight . w600 ) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 16. h ) ,
GridView . builder (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: ( isFoldable | | isTablet ) ? 6 : 4 , // 4 icons per row
crossAxisSpacing: 21. w ,
mainAxisSpacing: 18. h ,
childAspectRatio: 80 / 94 ) ,
physics: NeverScrollableScrollPhysics ( ) ,
shrinkWrap: true ,
itemCount: hmgServices . length ,
padding: EdgeInsets . zero ,
itemBuilder: ( BuildContext context , int index ) {
return ServiceGridViewItem ( hmgServices [ index ] , index , false , isHealthToolIcon: false ) ;
} ,
) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 24. h ) ,
LocaleKeys . hmgServices . tr ( ) . toText18 ( weight: FontWeight . w600 ) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 16. h ) ,
SizedBox (
height: 350. h ,
child: ListView . separated (
scrollDirection: Axis . horizontal ,
itemCount: LandingPageData . getServiceCardsList . length ,
shrinkWrap: true ,
padding: EdgeInsets . symmetric ( horizontal: 24. w ) ,
itemBuilder: ( context , index ) {
return AnimationConfiguration . staggeredList (
position: index ,
duration: const Duration ( milliseconds: 1000 ) ,
child: SlideAnimation (
horizontalOffset: 100.0 ,
child: FadeInAnimation (
child: LargeServiceCard (
serviceCardData: LandingPageData . getServiceCardsList [ index ] ,
image: LandingPageData . getServiceCardsList [ index ] . icon ,
title: LandingPageData . getServiceCardsList [ index ] . title ,
subtitle: LandingPageData . getServiceCardsList [ index ] . subtitle ,
icon: LandingPageData . getServiceCardsList [ index ] . largeCardIcon ,
) ,
) ,
) ,
) ;
} ,
separatorBuilder: ( BuildContext cxt , int index ) = > SizedBox ( width: 16. w ) ,
) ,
) ,
SizedBox ( height: 24. h ) ,
getIt . get < AppState > ( ) . isAuthenticated ? Column (
children: [
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: [
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 < AppState > ( ) . isArabic ( ) ? AppAssets . arrow_back : AppAssets . arrow_forward ) ,
] ,
) ,
Spacer ( ) ,
getIt . get < AppState > ( ) . isAuthenticated
? Consumer < HabibWalletViewModel > ( 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 < AppState > ( ) . 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 < AppState > ( ) . isAuthenticated ) {
Navigator . of ( context ) . push ( CustomPageRoute ( page: HabibWalletPage ( ) ) ) ;
} else {
await getIt . get < AuthenticationViewModel > ( ) . 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 ,
) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
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 < AppState > ( ) . isArabic ( ) ? AppAssets . arrow_back : AppAssets . arrow_forward ) ,
] ,
) ,
Spacer ( ) ,
getIt . get < AppState > ( ) . 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 < AppState > ( ) . 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 < DialogService > ( ) ;
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 < AppState > ( ) . isAuthenticated ) {
Navigator . of ( context ) . push (
CustomPageRoute (
page: MedicalFilePage ( ) ,
) ,
) ;
} else {
await getIt . get < AuthenticationViewModel > ( ) . onLoginPressed ( ) ;
}
} ) ,
) ,
) ,
] ,
) . paddingSymmetrical ( 24. w , 0 ) ,
] ,
) : SizedBox ( ) ,
SizedBox ( height: 24. h ) ,
LocaleKeys . healthTools . tr ( ) . toText18 ( weight: FontWeight . w600 ) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 16. h ) ,
GridView . builder (
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
crossAxisCount: ( isFoldable | | isTablet ) ? 6 : 4 , // 4 icons per row
crossAxisSpacing: 21. w ,
mainAxisSpacing: 18. h ,
childAspectRatio: 80. w / 94. h ,
) ,
physics: NeverScrollableScrollPhysics ( ) ,
shrinkWrap: true ,
itemCount: hmgHealthToolServices . length ,
padding: EdgeInsets . zero ,
itemBuilder: ( BuildContext context , int index ) {
return ServiceGridViewItem (
hmgHealthToolServices [ index ] ,
index ,
false ,
isHealthToolIcon: true ,
) ;
} ,
) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 24. h ) ,
LocaleKeys . supportServices . tr ( ) . toText18 ( weight: FontWeight . w600 ) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 16. h ) ,
Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Row (
children: [
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets (
icon: AppAssets . virtual_tour_icon ,
width: 32. w ,
height: 32. h ,
fit: BoxFit . contain ,
) ,
SizedBox ( width: 8. w ) ,
LocaleKeys . virtualTour . tr ( ) . toText14 ( weight: FontWeight . w500 )
] ,
) ,
) ,
) . onPress ( ( ) {
Utils . openWebView (
url: ' https://hmgwebservices.com/vt_mobile/html/index.html ' ,
) ;
} ) ,
) ,
SizedBox ( width: 16. w ) ,
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets (
icon: AppAssets . car_parking_icon ,
width: 32. w ,
height: 32. h ,
fit: BoxFit . contain ,
) ,
SizedBox ( width: 8. w ) ,
LocaleKeys . carParking . tr ( ) . toText14 ( weight: FontWeight . w500 )
] ,
) . onPress ( ( ) {
Navigator . push (
context ,
MaterialPageRoute (
builder: ( _ ) = > ChangeNotifierProvider (
create: ( _ ) = > getIt < QrParkingViewModel > ( ) ,
child: const ParkingPage ( ) ,
) ,
) ,
) ;
} ) ,
) ,
) ,
) ,
] ,
) ,
SizedBox ( height: 16. h ) ,
Row (
children: [
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets (
icon: AppAssets . latest_news_icon ,
width: 32. w ,
height: 32. h ,
fit: BoxFit . contain ,
) ,
SizedBox ( width: 8. w ) ,
LocaleKeys . latestNews . tr ( ) . toText14 ( weight: FontWeight . w500 )
] ,
) ,
) ,
) . onPress ( ( ) {
Utils . openWebView (
url: ' https://x.com/HMG ' ,
) ;
} ) ,
) ,
SizedBox ( width: 16. w ) ,
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets (
icon: AppAssets . hmg_contact_icon ,
width: 32. w ,
height: 32. h ,
fit: BoxFit . contain ,
) ,
SizedBox ( width: 8. w ) ,
Expanded ( child: LocaleKeys . hmgContact . tr ( ) . toText14 ( weight: FontWeight . w500 ) )
] ,
) ,
) ,
) . onPress ( ( ) {
showCommonBottomSheetWithoutHeight (
context ,
title: LocaleKeys . contactUs . tr ( ) ,
child: ContactUs ( ) ,
callBackFunc: ( ) { } ,
isFullScreen: false ,
) ;
} ) ,
)
] ,
) ,
SizedBox ( height: 24. h ) ,
LocaleKeys . hmgPolicies . tr ( ) . toText18 ( weight: FontWeight . bold ) ,
SizedBox ( height: 16. h ) ,
Row (
children: [
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets ( icon: AppAssets . privacy_terms , width: 32. w , height: 32. h , fit: BoxFit . contain , iconColor: AppColors . blackColor ) ,
SizedBox ( width: 8. w ) ,
Expanded ( child: LocaleKeys . termsConditoins . tr ( ) . toText14 ( weight: FontWeight . w500 ) )
] ,
) ,
) ,
) . onPress ( ( ) {
Utils . openWebView (
url: ' https://hmg.com/en/Pages/Terms.aspx ' ,
) ;
} ) ,
) ,
SizedBox ( width: 16. w ) ,
Expanded (
child: Container (
decoration: RoundedRectangleBorder ( ) . toSmoothCornerDecoration (
color: AppColors . whiteColor ,
borderRadius: 12. h ,
hasShadow: false ,
) ,
child: Padding (
padding: EdgeInsets . all ( 16. h ) ,
child: Row (
children: [
Utils . buildSvgWithAssets ( icon: AppAssets . privacy_terms , width: 32. w , height: 32. h , fit: BoxFit . contain , iconColor: AppColors . blackColor ) ,
SizedBox ( width: 8. w ) ,
Expanded ( child: LocaleKeys . privacyPolicy . tr ( ) . toText14 ( weight: FontWeight . w500 ) )
] ,
) ,
) ,
) . onPress ( ( ) {
Utils . openWebView (
url: ' https://hmg.com/en/Pages/Privacy.aspx ' ,
) ;
} ) ,
)
] ,
)
] ,
) . paddingSymmetrical ( 24. w , 0 ) ,
SizedBox ( height: 24. h ) ,
] ,
) ,
) ,
) ;
}
}