@ -21,8 +21,8 @@ import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import ' package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart ' ;
import ' package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart ' ;
import ' package:diplomaticquarterapp/pages/ErService/ErOptions.dart ' ;
import ' package:diplomaticquarterapp/pages/InPatientServices/inpatient_home.dart ' ;
import ' package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart ' ;
import ' package:diplomaticquarterapp/pages/landing/landing_page.dart ' ;
import ' package:diplomaticquarterapp/pages/livecare/livecare_home.dart ' ;
import ' package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart ' ;
import ' package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart ' ;
@ -40,7 +40,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import ' package:url_launcher/url_launcher.dart ' ;
import ' ../../../locator.dart ' ;
import ' ../landing_page.dart ' ;
import ' ../landing_page_pharmcy.dart ' ;
class ServicesView extends StatelessWidget {
@ -50,136 +49,18 @@ class ServicesView extends StatelessWidget {
AuthProvider authProvider = new AuthProvider ( ) ;
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
LocationUtils locationUtils ;
bool isHomePage ;
ServicesView ( this . hmgServices , this . index );
ServicesView ( this . hmgServices , this . index , this . isHomePage );
@ override
Widget build ( BuildContext context ) {
return InkWell (
onTap: ( ) {
if ( index = = 0 ) {
openLiveCare ( context ) ;
} else if ( index = = 1 ) {
showCovidDialog ( context ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' covid-test drive-thru ' ) ;
} else if ( index = = 2 ) {
Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' online payments ' ) ;
} else if ( index = = 3 ) {
Navigator . push ( context , FadePage ( page: HomeHealthCarePage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' home health care ' ) ;
} else if ( index = = 4 ) {
Navigator . push ( context , FadePage ( page: CMCPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' comprehensive medical checkup ' ) ;
} else if ( index = = 5 ) {
Navigator . push ( context , FadePage ( page: ErOptions ( isAppbar: true ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' emergency service ' ) ;
} else if ( index = = 6 ) {
Navigator . push ( context , FadePage ( page: EReferralPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' e-referral service ' ) ;
} else if ( index = = 7 ) {
Navigator . push ( context , FadePage ( page: H2OPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' water consumption ' ) ;
} else if ( index = = 8 ) {
Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' find us reach us ' ) ;
} else if ( index = = 9 ) {
Navigator . push (
context ,
FadePage (
page: MedicalProfilePageNew ( ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my medical details ' ) ;
} else if ( index = = 10 ) {
Navigator . push (
context ,
FadePage (
page: Search ( ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' book appointment ' ) ;
} else if ( index = = 11 ) {
getPharmacyToken ( context ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' al habib pharmacy ' ) ;
} else if ( index = = 12 ) {
Navigator . push (
context ,
FadePage (
page: InsuranceUpdate ( ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' update insurance ' ) ;
} else if ( index = = 13 ) {
Navigator . push (
context ,
FadePage (
page: MyFamily ( ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my family files ' ) ;
} else if ( index = = 14 ) {
Navigator . push (
context ,
FadePage ( page: ChildInitialPage ( ) ) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my child vaccines ' ) ;
} else if ( index = = 15 ) {
/ / Navigator . pop ( context ) ;
LandingPage . shared . switchToDoFromHMGServices ( ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' todo list ' ) ;
} else if ( index = = 16 ) {
Navigator . push (
context ,
FadePage ( page: BloodDonationPage ( ) ) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' blood donation ' ) ;
} else if ( index = = 17 ) {
Navigator . push (
context ,
FadePage (
page: ( HealthCalculators ( ) ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' health calculator ' ) ;
} else if ( index = = 18 ) {
Navigator . push (
context ,
FadePage (
page: HealthConverter ( ) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' heath converters ' ) ;
} else if ( index = = 19 ) {
Navigator . push (
context ,
FadePage ( page: SmartWatchInstructions ( ) ) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' smart watches ' ) ;
} else if ( index = = 20 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' car parcking service ' ) ;
Navigator . push (
context ,
FadePage (
page: ParkingPage ( ) ,
) ,
) ;
} else if ( index = = 21 ) {
launch ( " https://hmgwebservices.com/vt_mobile/html/index.html " ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' virtual tour ' ) ;
} else if ( index = = 22 ) {
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > MyWebView (
title: " HMG News " ,
selectedUrl: " https://twitter.com/hashtag/مجموعة_د_سليما ن_ا لحبيب_ا لطبية?src=hashtag_click&f=live " ,
) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' latest news ' ) ;
} else if ( index = = 23 ) {
Navigator . push ( context , FadePage ( page: InPatientServicesHome ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' InPatient Services ' ) ;
if ( isHomePage ) {
handleHomePageServices ( hmgServices , context ) ;
} else {
handleAllServices ( hmgServices , context ) ;
}
} ,
child: Container (
@ -206,7 +87,7 @@ class ServicesView extends StatelessWidget {
padding: const EdgeInsets . all ( 12.0 ) ,
child: Opacity (
opacity: 0.04 ,
child: hmgServices . action = = 2
child: hmgServices . action = = 5
? Image . asset (
hmgServices . icon ,
width: double . infinity ,
@ -235,7 +116,7 @@ class ServicesView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
mFlex ( 1 ) ,
hmgServices . action = = 2
hmgServices . action = = ( isHomePage ? 5 : 8 )
? Image . asset (
hmgServices . icon ,
height: index = = 0 ? MediaQuery . of ( context ) . size . width / 18 : MediaQuery . of ( context ) . size . width / 18 ,
@ -282,6 +163,236 @@ class ServicesView extends StatelessWidget {
) ;
}
handleHomePageServices ( HmgServices hmgServices , BuildContext context ) {
if ( hmgServices . action = = 0 ) {
Navigator . push ( context , FadePage ( page: Search ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' book appointment ' ) ;
} else if ( hmgServices . action = = 1 ) {
openLiveCare ( context ) ;
} else if ( hmgServices . action = = 2 ) {
Navigator . push ( context , FadePage ( page: ErOptions ( isAppbar: true ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' emergency service ' ) ;
} else if ( hmgServices . action = = 3 ) {
Navigator . push ( context , FadePage ( page: HomeHealthCarePage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' home health care ' ) ;
} else if ( hmgServices . action = = 4 ) {
Navigator . push ( context , FadePage ( page: CMCPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' comprehensive medical checkup ' ) ;
} else if ( hmgServices . action = = 5 ) {
Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' online payments ' ) ;
} else if ( hmgServices . action = = 6 ) {
Navigator . push ( context , FadePage ( page: EReferralPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' e-referral service ' ) ;
} else if ( hmgServices . action = = 7 ) {
showCovidDialog ( context ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' covid-test drive-thru ' ) ;
} else if ( hmgServices . action = = 8 ) {
Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' find us reach us ' ) ;
}
}
handleAllServices ( HmgServices hmgServices , BuildContext context ) {
if ( hmgServices . action = = 0 ) {
Navigator . push ( context , FadePage ( page: Search ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' book appointment ' ) ;
} else if ( hmgServices . action = = 1 ) {
openLiveCare ( context ) ;
} else if ( hmgServices . action = = 2 ) {
Navigator . push ( context , FadePage ( page: ErOptions ( isAppbar: true ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' emergency service ' ) ;
} else if ( hmgServices . action = = 3 ) {
Navigator . push ( context , FadePage ( page: HomeHealthCarePage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' home health care ' ) ;
} else if ( hmgServices . action = = 4 ) {
Navigator . push ( context , FadePage ( page: CMCPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' comprehensive medical checkup ' ) ;
} else if ( hmgServices . action = = 5 ) {
getPharmacyToken ( context ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' al habib pharmacy ' ) ;
} else if ( hmgServices . action = = 6 ) {
Navigator . push ( context , FadePage ( page: MedicalProfilePageNew ( ) ) ) ;
} else if ( hmgServices . action = = 7 ) {
Navigator . push ( context , FadePage ( page: MyFamily ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my family files ' ) ;
} else if ( hmgServices . action = = 8 ) {
Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' online payments ' ) ;
} else if ( hmgServices . action = = 9 ) {
Navigator . push ( context , FadePage ( page: ChildInitialPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my child vaccines ' ) ;
} else if ( hmgServices . action = = 10 ) {
Navigator . push ( context , FadePage ( page: InsuranceUpdate ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' update insurance ' ) ;
} else if ( hmgServices . action = = 11 ) {
Navigator . push ( context , FadePage ( page: EReferralPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' e-referral service ' ) ;
} else if ( hmgServices . action = = 12 ) {
Navigator . push ( context , FadePage ( page: H2OPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' water consumption ' ) ;
} else if ( hmgServices . action = = 13 ) {
Navigator . push ( context , FadePage ( page: ( HealthCalculators ( ) ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' health calculator ' ) ;
} else if ( hmgServices . action = = 14 ) {
Navigator . push ( context , FadePage ( page: HealthConverter ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' heath converters ' ) ;
} else if ( hmgServices . action = = 15 ) {
Navigator . pop ( context ) ;
LandingPage . shared . switchToDoFromHMGServices ( ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' todo list ' ) ;
} else if ( hmgServices . action = = 16 ) {
Navigator . push ( context , FadePage ( page: BloodDonationPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' blood donation ' ) ;
} else if ( hmgServices . action = = 17 ) {
showCovidDialog ( context ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' covid-test drive-thru ' ) ;
} else if ( hmgServices . action = = 18 ) {
launch ( " https://hmgwebservices.com/vt_mobile/html/index.html " ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' virtual tour ' ) ;
} else if ( hmgServices . action = = 19 ) {
Navigator . push ( context , FadePage ( page: SmartWatchInstructions ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' smart watches ' ) ;
} else if ( hmgServices . action = = 20 ) {
Navigator . push ( context , FadePage ( page: ParkingPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' car parcking service ' ) ;
} else if ( hmgServices . action = = 21 ) {
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > MyWebView (
title: " HMG News " ,
selectedUrl: " https://twitter.com/hashtag/مجموعة_د_سليما ن_ا لحبيب_ا لطبية?src=hashtag_click&f=live " ,
) ,
) ,
) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' latest news ' ) ;
} else if ( hmgServices . action = = 22 ) {
Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' find us reach us ' ) ;
}
/ / if ( hmgServices . action = = 10 ) {
/ / openLiveCare ( context ) ;
/ / } else if ( index = = 1 ) {
/ / showCovidDialog ( context ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' covid-test drive-thru ' ) ;
/ / } else if ( index = = 2 ) {
/ / Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' online payments ' ) ;
/ / } else if ( index = = 3 ) {
/ / Navigator . push ( context , FadePage ( page: HomeHealthCarePage ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' home health care ' ) ;
/ / } else if ( index = = 4 ) {
/ / Navigator . push ( context , FadePage ( page: CMCPage ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' comprehensive medical checkup ' ) ;
/ / } else if ( index = = 5 ) {
/ / Navigator . push ( context , FadePage ( page: ErOptions ( isAppbar: true ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' emergency service ' ) ;
/ / } else if ( index = = 6 ) {
/ / Navigator . push ( context , FadePage ( page: EReferralPage ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' e-referral service ' ) ;
/ / } else if ( index = = 7 ) {
/ / Navigator . push ( context , FadePage ( page: H2OPage ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' water consumption ' ) ;
/ / } else if ( index = = 8 ) {
/ / Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' find us reach us ' ) ;
/ / } else if ( index = = 9 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: MedicalProfilePageNew ( ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my medical details ' ) ;
/ / } else if ( index = = 10 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: Search ( ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' book appointment ' ) ;
/ / } else if ( index = = 11 ) {
/ / getPharmacyToken ( context ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' al habib pharmacy ' ) ;
/ / } else if ( index = = 12 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: InsuranceUpdate ( ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' update insurance ' ) ;
/ / } else if ( index = = 13 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: MyFamily ( ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my family files ' ) ;
/ / } else if ( index = = 14 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage ( page: ChildInitialPage ( ) ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my child vaccines ' ) ;
/ / } else if ( index = = 15 ) {
/ / LandingPage . shared . switchToDoFromHMGServices ( ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' todo list ' ) ;
/ / } else if ( index = = 16 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage ( page: BloodDonationPage ( ) ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' blood donation ' ) ;
/ / } else if ( index = = 17 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: ( HealthCalculators ( ) ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' health calculator ' ) ;
/ / } else if ( index = = 18 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: HealthConverter ( ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' heath converters ' ) ;
/ / } else if ( index = = 19 ) {
/ / Navigator . push (
/ / context ,
/ / FadePage ( page: SmartWatchInstructions ( ) ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' smart watches ' ) ;
/ / } else if ( index = = 20 ) {
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' car parcking service ' ) ;
/ / Navigator . push (
/ / context ,
/ / FadePage (
/ / page: ParkingPage ( ) ,
/ / ) ,
/ / ) ;
/ / } else if ( index = = 21 ) {
/ / launch ( " https://hmgwebservices.com/vt_mobile/html/index.html " ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' virtual tour ' ) ;
/ / } else if ( index = = 22 ) {
/ / Navigator . of ( context ) . push (
/ / MaterialPageRoute (
/ / builder: ( BuildContext context ) = > MyWebView (
/ / title: " HMG News " ,
/ / selectedUrl: " https://twitter.com/hashtag/مجموعة_د_سليما ن_ا لحبيب_ا لطبية?src=hashtag_click&f=live " ,
/ / ) ,
/ / ) ,
/ / ) ;
/ / locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' latest news ' ) ;
/ / }
}
showCovidDialog ( BuildContext context ) {
if ( Platform . isAndroid ) {
showDialog (