import ' package:auto_size_text/auto_size_text.dart ' ;
import ' package:diplomaticquarterapp/analytics/google-analytics.dart ' ;
import ' package:diplomaticquarterapp/config/size_config.dart ' ;
import ' package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart ' ;
import ' package:diplomaticquarterapp/models/Authentication/authenticated_user.dart ' ;
import ' package:diplomaticquarterapp/models/hmg_services.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_page.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart ' ;
import ' package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart ' ;
import ' package:diplomaticquarterapp/pages/Blood/blood_donation.dart ' ;
import ' package:diplomaticquarterapp/pages/BookAppointment/Search.dart ' ;
import ' package:diplomaticquarterapp/pages/ChildVaccines/new/child_initial_page.dart ' ;
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/insurance/insurance_update_screen.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 ' ;
import ' package:diplomaticquarterapp/pages/paymentService/payment_service.dart ' ;
import ' package:diplomaticquarterapp/services/authentication/auth_provider.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.dart ' ;
import ' package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart ' ;
import ' package:diplomaticquarterapp/uitl/translations_delegate_base.dart ' ;
import ' package:diplomaticquarterapp/uitl/utils_new.dart ' ;
import ' package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/transitions/fade_page.dart ' ;
import ' package:flutter/material.dart ' ;
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 {
HmgServices hmgServices ;
int index ;
AuthenticatedUser authUser = new AuthenticatedUser ( ) ;
AuthProvider authProvider = new AuthProvider ( ) ;
PharmacyModuleViewModel pharmacyModuleViewModel = locator < PharmacyModuleViewModel > ( ) ;
ServicesView ( this . hmgServices , this . index ) ;
@ override
Widget build ( BuildContext context ) {
return InkWell (
onTap: ( ) {
if ( index = = 0 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' live care service ' ) ;
Navigator . push ( context , FadePage ( page: LiveCareHome ( ) ) ) . then ( ( value ) {
LiveCareHome . isLiveCareTypeSelected = false ;
} ) ;
} else if ( index = = 1 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' covid-test drive-thru ' ) ;
showCovidDialog ( context ) ;
} else if ( index = = 2 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' online payments ' ) ;
Navigator . push ( context , FadePage ( page: PaymentService ( ) ) ) ;
} else if ( index = = 3 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' home health care ' ) ;
Navigator . push ( context , FadePage ( page: HomeHealthCarePage ( ) ) ) ;
} else if ( index = = 4 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' comprehensive medical checkup ' ) ;
Navigator . push ( context , FadePage ( page: CMCPage ( ) ) ) ;
} else if ( index = = 5 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' emergency service ' ) ;
Navigator . push ( context , FadePage ( page: ErOptions ( isAppbar: true ) ) ) ;
} else if ( index = = 6 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' e-referral service ' ) ;
Navigator . push ( context , FadePage ( page: EReferralPage ( ) ) ) ;
} else if ( index = = 7 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' water consumption ' ) ;
Navigator . push ( context , FadePage ( page: H2OPage ( ) ) ) ;
} else if ( index = = 8 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' find us reach us ' ) ;
Navigator . push ( context , FadePage ( page: ContactUsPage ( ) ) ) ;
} else if ( index = = 9 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my medical details ' ) ;
Navigator . push (
context ,
FadePage (
page: MedicalProfilePageNew ( ) ,
) ,
) ;
} else if ( index = = 10 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' book appointment ' ) ;
Navigator . push (
context ,
FadePage (
page: Search ( ) ,
) ,
) ;
} else if ( index = = 11 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' al habib pharmacy ' ) ;
getPharmacyToken ( context ) ;
} else if ( index = = 12 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' update insurance ' ) ;
Navigator . push (
context ,
FadePage (
page: InsuranceUpdate ( ) ,
) ,
) ;
} else if ( index = = 13 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my family files ' ) ;
Navigator . push (
context ,
FadePage (
page: MyFamily ( ) ,
) ,
) ;
} else if ( index = = 14 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' my child vaccines ' ) ;
Navigator . push (
context ,
FadePage ( page: ChildInitialPage ( ) ) ,
) ;
} else if ( index = = 15 ) {
// Navigator.pop(context);
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' todo list ' ) ;
LandingPage . shared . switchToDoFromHMGServices ( ) ;
} else if ( index = = 16 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' blood donation ' ) ;
Navigator . push (
context ,
FadePage ( page: BloodDonationPage ( ) ) ,
) ;
} else if ( index = = 17 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' health calculator ' ) ;
Navigator . push (
context ,
FadePage (
page: ( HealthCalculators ( ) ) ,
) ,
) ;
} else if ( index = = 18 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' heath converters ' ) ;
Navigator . push (
context ,
FadePage (
page: HealthConverter ( ) ,
) ,
) ;
} else if ( index = = 19 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' smart watches ' ) ;
Navigator . push (
context ,
FadePage ( page: SmartWatchInstructions ( ) ) ,
) ;
} else if ( index = = 20 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' car parcking service ' ) ;
Navigator . push (
context ,
FadePage (
page: ParkingPage ( ) ,
) ,
) ;
} else if ( index = = 21 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' virtual tour ' ) ;
launch ( " https://hmgwebservices.com/vt_mobile/html/index.html " ) ;
} else if ( index = = 22 ) {
locator < GAnalytics > ( ) . hmgServices . logServiceName ( ' latest news ' ) ;
Navigator . of ( context ) . push (
MaterialPageRoute (
builder: ( BuildContext context ) = > MyWebView (
title: " HMG News " ,
selectedUrl: " https://twitter.com/hashtag/مجموعة_د_سليما ن_ا لحبيب_ا لطبية?src=hashtag_click&f=live " ,
) ,
) ,
) ;
}
} ,
child: Container (
width: double . infinity ,
height: double . infinity ,
decoration: containerRadiusWithGradientServices ( 20 , lightColor: CustomColors . lightGreyColor , darkColor: CustomColors . darkGreyColor ) ,
child: Stack (
children: [
Container (
width: double . infinity ,
height: double . infinity ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
mainAxisAlignment: MainAxisAlignment . start ,
children: [
mFlex ( 1 ) ,
Flexible (
flex: 8 ,
child: Column (
children: [
Flexible (
flex: 5 ,
child: Padding (
padding: const EdgeInsets . all ( 12.0 ) ,
child: Opacity (
opacity: 0.04 ,
child: hmgServices . action = = 2
? Image . asset (
hmgServices . icon ,
width: double . infinity ,
height: double . infinity ,
)
: SvgPicture . asset (
hmgServices . icon ,
width: double . infinity ,
height: double . infinity ,
) ,
) ,
) ,
) ,
mFlex ( 1 ) ,
] ,
) ,
) ,
] ,
) ,
) ,
Container (
width: double . infinity ,
height: double . infinity ,
padding: EdgeInsets . only ( left: SizeConfig . widthMultiplier * 3 , right: SizeConfig . widthMultiplier * 3 , top: SizeConfig . widthMultiplier * 3 , bottom: SizeConfig . widthMultiplier * 2 ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
mFlex ( 1 ) ,
hmgServices . action = = 2
? Image . asset (
hmgServices . icon ,
height: index = = 0 ? MediaQuery . of ( context ) . size . width / 18 : MediaQuery . of ( context ) . size . width / 18 ,
)
: Container (
// color: Colors.yellow,
width: index = = 4 ? MediaQuery . of ( context ) . size . width / 12 : MediaQuery . of ( context ) . size . width / 12 ,
height: index = = 4 ? MediaQuery . of ( context ) . size . width / 10 : MediaQuery . of ( context ) . size . width / 12 ,
child: SvgPicture . asset (
hmgServices . icon ,
// width: MediaQuery.of(context).size.width / 12,
// height: MediaQuery.of(context).size.width / 12,
) ,
) ,
mFlex ( 4 ) ,
AutoSizeText (
hmgServices . title ,
maxLines: 1 ,
minFontSize: 10 ,
style: TextStyle (
fontSize: SizeConfig . textMultiplier * 1.6 ,
fontWeight: FontWeight . bold ,
letterSpacing: - 0.39 ,
height: 0.8 ,
) ,
) ,
AutoSizeText (
hmgServices . subTitle ,
maxLines: 1 ,
minFontSize: 8 ,
style: TextStyle (
fontSize: SizeConfig . textMultiplier * 1.4 ,
letterSpacing: - 0.27 ,
fontWeight: FontWeight . w600 ,
) ,
) ,
mFlex ( 1 ) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ;
}
showCovidDialog ( BuildContext context ) {
showDialog (
context: context ,
builder: ( cxt ) = > CovidConsentDialog (
okTitle: TranslationBase . of ( context ) . acceptLbl ,
title: " User Consent " ,
message:
" Covid-19 Test feature allows you to book appointment for Covid-19 Lab test within HMG branches where a swab sample will be collected & will be processed. Once the result has been processed you shall be notified via SMS on your registered mobile number & the test result will also be available in the Lab Results section of this app. Please note that this result is only available to you & not publicly available to anyone else. \n Please accept to confirm & proceed. " ,
onTap: ( ) async {
Navigator . push ( context , FadePage ( page: CovidDrivethruLocation ( ) ) ) ;
} ,
) ) ;
}
getPharmacyToken ( BuildContext context ) async {
if ( ! authProvider . isLogin ) {
Navigator . push ( context , FadePage ( page: LandingPagePharmacy ( ) ) ) ;
} else {
GifLoaderDialogUtils . showMyDialog ( context ) ;
await pharmacyModuleViewModel . generatePharmacyToken ( ) . then ( ( value ) async {
if ( pharmacyModuleViewModel . error . isNotEmpty ) {
await pharmacyModuleViewModel . createUser ( ) . then ( ( value ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
Navigator . push ( context , FadePage ( page: LandingPagePharmacy ( ) ) ) ;
} ) ;
} else {
GifLoaderDialogUtils . hideDialog ( context ) ;
Navigator . push ( context , FadePage ( page: LandingPagePharmacy ( ) ) ) ;
}
} ) ;
}
}
}