@ -61,10 +61,8 @@ class Utils {
/ / / Check The Internet Connection
static Future < bool > checkConnection ( ) async {
ConnectivityResult connectivityResult =
await ( Connectivity ( ) . checkConnectivity ( ) ) ;
if ( ( connectivityResult = = ConnectivityResult . mobile ) | |
( connectivityResult = = ConnectivityResult . wifi ) ) {
ConnectivityResult connectivityResult = await ( Connectivity ( ) . checkConnectivity ( ) ) ;
if ( ( connectivityResult = = ConnectivityResult . mobile ) | | ( connectivityResult = = ConnectivityResult . wifi ) ) {
return true ;
} else {
return false ;
@ -128,19 +126,11 @@ class Utils {
}
static String getAppointmentTransID ( int projectID , int clinicID , int appoNo ) {
return projectID . toString ( ) +
' - ' +
clinicID . toString ( ) +
' - ' +
appoNo . toString ( ) ;
return projectID . toString ( ) + ' - ' + clinicID . toString ( ) + ' - ' + appoNo . toString ( ) ;
}
static String getAdvancePaymentTransID ( int projectID , int fileNumber ) {
return projectID . toString ( ) +
' - ' +
fileNumber . toString ( ) +
' - ' +
DateTime . now ( ) . millisecondsSinceEpoch . toString ( ) ;
return projectID . toString ( ) + ' - ' + fileNumber . toString ( ) + ' - ' + DateTime . now ( ) . millisecondsSinceEpoch . toString ( ) ;
}
bool validateIDBox ( String value , type ) {
@ -198,53 +188,49 @@ class Utils {
}
static validEmail ( email ) {
return RegExp (
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+" )
. hasMatch ( email ) ;
return RegExp ( r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+" ) . hasMatch ( email ) ;
}
static List < Widget > myMedicalList (
{ ProjectViewModel projectViewModel ,
BuildContext context ,
bool isLogin ,
count } ) {
static List < Widget > myMedicalList ( { ProjectViewModel projectViewModel , BuildContext context , bool isLogin , count } ) {
List < Widget > medical = List ( ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 5 )
? Navigator . push ( context , FadePage ( page: MyAppointments ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 5 ) ? Navigator . push ( context , FadePage ( page: MyAppointments ( ) ) ) : null ,
child: isLogin
? Stack ( children: [
MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' my_appointment_icon.png ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ) ,
Positioned (
right: 0.0 ,
child: Badge (
toAnimate: false ,
position: BadgePosition . topEnd ( ) ,
shape: BadgeShape . circle ,
badgeColor: secondaryColor . withOpacity ( 1.0 ) ,
borderRadius: BorderRadius . circular ( 8 ) ,
badgeContent: Container (
padding: EdgeInsets . all ( 2.0 ) ,
child: Text ( count . toString ( ) ,
style: TextStyle ( color: Colors . white , fontSize: 16.0 ) ) ,
) ,
) ,
) ,
] )
Container (
width: double . infinity ,
height: double . infinity ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.svg ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ) ,
) ,
Positioned (
right: 8 ,
top: 4 ,
child: Badge (
toAnimate: false ,
position: BadgePosition . topEnd ( ) ,
shape: BadgeShape . circle ,
badgeColor: secondaryColor . withOpacity ( 1.0 ) ,
borderRadius: BorderRadius . circular ( 8 ) ,
badgeContent: Container (
padding: EdgeInsets . all ( 2.0 ) ,
child: Text ( count . toString ( ) , style: TextStyle ( color: Colors . white , fontSize: 16.0 ) ) ,
) ,
) ,
) ,
] )
: MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' my_appointment_icon.png ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ,
) ,
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.sv g' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ,
) ,
) ) ;
if ( projectViewModel . havePrivilege ( 10 ) ) {
@ -252,31 +238,27 @@ class Utils {
onTap: ( ) = > Navigator . push ( context , FadePage ( page: LabsHomePage ( ) ) ) ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . lab ,
imagePath: ' lab_result _icon.pn g' ,
imagePath: ' lab_result .sv g' ,
subTitle: TranslationBase . of ( context ) . labSubtitle ,
) ,
) ) ;
}
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 7 )
? Navigator . push ( context , FadePage ( page: RadiologyHomePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 7 ) ? Navigator . push ( context , FadePage ( page: RadiologyHomePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . radiology ,
imagePath: ' radiology _icon.pn g' ,
imagePath: ' radiology .sv g' ,
subTitle: TranslationBase . of ( context ) . radiologySubtitle ,
isEnable: projectViewModel . havePrivilege ( 7 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 12 )
? Navigator . push ( context , FadePage ( page: HomePrescriptionsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 12 ) ? Navigator . push ( context , FadePage ( page: HomePrescriptionsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . medicines ,
imagePath: ' prescription_icon.pn g' ,
imagePath: ' medicine_prescription.sv g' ,
subTitle: TranslationBase . of ( context ) . medicinesSubtitle ,
isEnable: projectViewModel . havePrivilege ( 12 ) ,
) ,
@ -285,25 +267,23 @@ class Utils {
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 25 )
? Navigator . push (
context ,
FadePage ( page: VitalSignDetailsScreen ( ) ) ,
)
context ,
FadePage ( page: VitalSignDetailsScreen ( ) ) ,
)
: null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . vitalSigns ,
imagePath: ' vital_signs. pn g' ,
imagePath: ' vital_signs. sv g' ,
subTitle: TranslationBase . of ( context ) . vitalSignsSubtitle ,
isEnable: projectViewModel . havePrivilege ( 25 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 48 )
? Navigator . push ( context , FadePage ( page: ActiveMedicationsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 48 ) ? Navigator . push ( context , FadePage ( page: ActiveMedicationsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myMedical ,
imagePath: ' active_medication s.pn g' ,
imagePath: ' active_medication .sv g' ,
subTitle: TranslationBase . of ( context ) . myMedicalSubtitle ,
isEnable: false ,
) ,
@ -312,38 +292,31 @@ class Utils {
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 6 )
? Navigator . push (
context ,
FadePage (
page: DoctorHomePage ( ) ,
) ,
)
context ,
FadePage (
page: DoctorHomePage ( ) ,
) ,
)
: null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myDoctor ,
imagePath: ' doctor_icon.png ' ,
subTitle: TranslationBase . of ( context ) . myDoctorSubtitle ,
isEnable: projectViewModel . havePrivilege ( 6 ) ) ,
child:
MedicalProfileItem ( title: TranslationBase . of ( context ) . myDoctor , imagePath: ' my_doc.svg ' , subTitle: TranslationBase . of ( context ) . myDoctorSubtitle , isEnable: projectViewModel . havePrivilege ( 6 ) ) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 14 )
? Navigator . push ( context , FadePage ( page: EyeMeasurementsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 14 ) ? Navigator . push ( context , FadePage ( page: EyeMeasurementsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . eye ,
imagePath: ' eye_measurement _icon.pn g' ,
imagePath: ' eye_measurement .sv g' ,
subTitle: TranslationBase . of ( context ) . eyeSubtitle ,
isEnable: projectViewModel . havePrivilege ( 14 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 22 )
? Navigator . push ( context , FadePage ( page: InsuranceCard ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 22 ) ? Navigator . push ( context , FadePage ( page: InsuranceCard ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . insurance ,
imagePath: ' insurance_card _icon.pn g' ,
imagePath: ' insurance_card .sv g' ,
subTitle: TranslationBase . of ( context ) . insuranceSubtitle ,
isEnable: projectViewModel . havePrivilege ( 22 ) ,
) ,
@ -355,90 +328,76 @@ class Utils {
} ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . updateInsurance ,
imagePath: ' insurance_ update_icon_.pn g' ,
imagePath: ' insurance_ card.sv g' ,
subTitle: TranslationBase . of ( context ) . updateInsuranceSubtitle ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 18 )
? Navigator . push ( context , FadePage ( page: InsuranceApproval ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 18 ) ? Navigator . push ( context , FadePage ( page: InsuranceApproval ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . insuranceApproval ,
imagePath: ' insurance_approval s_icon.pn g' ,
imagePath: ' insurance_approval .sv g' ,
subTitle: TranslationBase . of ( context ) . insuranceApprovalSubtitle ,
isEnable: projectViewModel . havePrivilege ( 18 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 23 )
? Navigator . push ( context , FadePage ( page: AllergiesPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 23 ) ? Navigator . push ( context , FadePage ( page: AllergiesPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . allergies ,
imagePath: ' my_allergies_icon.pn g' ,
imagePath: ' allergies_diagnosed.sv g' ,
subTitle: TranslationBase . of ( context ) . allergiesSubtitle ,
isEnable: projectViewModel . havePrivilege ( 23 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 26 )
? Navigator . push ( context , FadePage ( page: MyVaccines ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 26 ) ? Navigator . push ( context , FadePage ( page: MyVaccines ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myVaccines ,
imagePath: ' my_vaccines_icon.pn g' ,
imagePath: ' vaccine_list.sv g' ,
subTitle: TranslationBase . of ( context ) . myVaccinesSubtitle ,
isEnable: projectViewModel . havePrivilege ( 26 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 20 )
? Navigator . push ( context , FadePage ( page: HomeReportPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 20 ) ? Navigator . push ( context , FadePage ( page: HomeReportPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . medical ,
imagePath: ' medical_report s_icon.pn g' ,
imagePath: ' medical_report .sv g' ,
subTitle: TranslationBase . of ( context ) . medicalSubtitle ,
isEnable: projectViewModel . havePrivilege ( 20 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 19 )
? Navigator . push ( context , FadePage ( page: MonthlyReportsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 19 ) ? Navigator . push ( context , FadePage ( page: MonthlyReportsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . monthly ,
imagePath: ' monthly_report s_icon.pn g' ,
imagePath: ' monthly_report .sv g' ,
subTitle: TranslationBase . of ( context ) . monthlySubtitle ,
isEnable: projectViewModel . havePrivilege ( 19 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 16 )
? Navigator . push ( context , FadePage ( page: PatientSickLeavePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 16 ) ? Navigator . push ( context , FadePage ( page: PatientSickLeavePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . sick ,
imagePath: ' sick_leave s_icons.pn g' ,
imagePath: ' sick_leave .sv g' ,
subTitle: TranslationBase . of ( context ) . sickSubtitle ,
isEnable: projectViewModel . havePrivilege ( 16 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 47 )
? Navigator . push ( context , FadePage ( page: MyBalancePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 47 ) ? Navigator . push ( context , FadePage ( page: MyBalancePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myBalance ,
imagePath: ' check-in.pn g' ,
imagePath: ' balance_credit.sv g' ,
subTitle: TranslationBase . of ( context ) . myBalanceSubtitle ,
isEnable: projectViewModel . havePrivilege ( 47 ) ,
) ,
@ -452,38 +411,29 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 24 )
? Navigator . push ( context , FadePage ( page: MyTrackers ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 24 ) ? Navigator . push ( context , FadePage ( page: MyTrackers ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myTrackers ,
imagePath: ' my_tracker_icon.pn g' ,
imagePath: ' tracker.sv g' ,
subTitle: TranslationBase . of ( context ) . myTrackersSubtitle ,
isEnable: projectViewModel . havePrivilege ( 24 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 30 )
? Navigator . push ( context , FadePage ( page: SmartWatchInstructions ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 30 ) ? Navigator . push ( context , FadePage ( page: SmartWatchInstructions ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . smartWatches ,
imagePath: ' smart watch_icon.pn g' ,
imagePath: ' smart _watch.sv g' ,
subTitle: TranslationBase . of ( context ) . smartWatchesSubtitle ,
isEnable: projectViewModel . havePrivilege ( 30 ) ,
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 28 )
? Navigator . push ( context , FadePage ( page: AskDoctorHomPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 28 ) ? Navigator . push ( context , FadePage ( page: AskDoctorHomPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . askYour ,
imagePath: ' ask_doctor_icon.png ' ,
subTitle: TranslationBase . of ( context ) . askYourSubtitle ,
isEnable: projectViewModel . havePrivilege ( 28 ) ) ,
title: TranslationBase . of ( context ) . askYour , imagePath: ' ask_doctor.svg ' , subTitle: TranslationBase . of ( context ) . askYourSubtitle , isEnable: projectViewModel . havePrivilege ( 28 ) ) ,
) ) ;
if ( projectViewModel . havePrivilege ( 32 ) | | true ) {
@ -493,15 +443,11 @@ class Utils {
if ( projectViewModel . isLogin & & userData_ ! = null ) {
String patientID = userData_ . patientID . toString ( ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
projectViewModel
. platformBridge ( )
. connectHMGInternetWifi ( patientID )
. then ( ( value ) = > { GifLoaderDialogUtils . hideDialog ( context ) } ) ;
projectViewModel . platformBridge ( ) . connectHMGInternetWifi ( patientID ) . then ( ( value ) = > { GifLoaderDialogUtils . hideDialog ( context ) } ) ;
} else {
AlertDialogBox (
context: context ,
confirmMessage:
" Please login with your account first to use this feature " ,
confirmMessage: " Please login with your account first to use this feature " ,
okText: " OK " ,
okFunction: ( ) {
AlertDialogBox . closeAlertDialog ( context ) ;
@ -511,19 +457,17 @@ class Utils {
} ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . internet ,
imagePath: ' in surance_card_icon.pn g' ,
imagePath: ' in ternet_connection.sv g' ,
subTitle: TranslationBase . of ( context ) . internetSubtitle ,
) ,
) ) ;
}
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 40 )
? launch ( ' whatsapp://send?phone=18885521858&text= ' )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 40 ) ? launch ( ' whatsapp://send?phone=18885521858&text= ' ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . chatbot ,
imagePath: ' insurance_approvals_icon.pn g' ,
imagePath: ' chatbot.sv g' ,
subTitle: TranslationBase . of ( context ) . chatbotSubtitle ,
isEnable: projectViewModel . havePrivilege ( 40 ) ,
) ,
@ -532,51 +476,60 @@ class Utils {
return medical ;
}
static List < Widget > myMedicalListHomePage (
{ ProjectViewModel projectViewModel ,
BuildContext context ,
bool isLogin ,
count } ) {
static List < Widget > myMedicalListHomePage ( { ProjectViewModel projectViewModel , BuildContext context , bool isLogin , count } ) {
List < Widget > medical = List ( ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 5 )
? Navigator . push ( context , FadePage ( page: MyAppointments ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 5 ) ? Navigator . push ( context , FadePage ( page: MyAppointments ( ) ) ) : null ,
child: isLogin
? Stack ( children: [
MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.svg ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ) ,
Positioned (
right: 8 ,
top: 4 ,
child: Badge (
toAnimate: false ,
elevation: 0 ,
position: BadgePosition . topEnd ( ) ,
shape: BadgeShape . circle ,
badgeColor: secondaryColor . withOpacity ( 1.0 ) ,
borderRadius: BorderRadius . circular ( 8 ) ,
badgeContent: Container (
padding: EdgeInsets . all ( 2.0 ) ,
child: Text ( count . toString ( ) ,
style: TextStyle ( color: Colors . white , fontWeight: FontWeight . bold , fontSize: 12.0 ) ) ,
) ,
) ,
) ,
] )
MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.svg ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ) ,
projectViewModel . isArabic
? Positioned (
left: 8 ,
top: 4 ,
child: Badge (
toAnimate: false ,
elevation: 0 ,
position: BadgePosition . topEnd ( ) ,
shape: BadgeShape . circle ,
badgeColor: secondaryColor . withOpacity ( 1.0 ) ,
borderRadius: BorderRadius . circular ( 8 ) ,
badgeContent: Container (
padding: EdgeInsets . all ( 2.0 ) ,
child: Text ( count . toString ( ) , style: TextStyle ( color: Colors . white , fontWeight: FontWeight . bold , fontSize: 12.0 ) ) ,
) ,
) ,
)
: Positioned (
right: 8 ,
top: 4 ,
child: Badge (
toAnimate: false ,
elevation: 0 ,
position: BadgePosition . topEnd ( ) ,
shape: BadgeShape . circle ,
badgeColor: secondaryColor . withOpacity ( 1.0 ) ,
borderRadius: BorderRadius . circular ( 8 ) ,
badgeContent: Container (
padding: EdgeInsets . all ( 2.0 ) ,
child: Text ( count . toString ( ) , style: TextStyle ( color: Colors . white , fontWeight: FontWeight . bold , fontSize: 12.0 ) ) ,
) ,
) ,
) ,
] )
: MedicalProfileItem (
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.svg ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ,
) ,
title: TranslationBase . of ( context ) . myAppointments ,
imagePath: ' appointment_list.svg ' ,
subTitle: TranslationBase . of ( context ) . myAppointmentsList ,
hasBadge: true ,
isEnable: projectViewModel . havePrivilege ( 5 ) ,
) ,
) ) ;
if ( projectViewModel . havePrivilege ( 10 ) ) {
@ -591,9 +544,7 @@ class Utils {
}
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 7 )
? Navigator . push ( context , FadePage ( page: RadiologyHomePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 7 ) ? Navigator . push ( context , FadePage ( page: RadiologyHomePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . radiology ,
imagePath: ' radiology.svg ' ,
@ -605,24 +556,18 @@ class Utils {
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 6 )
? Navigator . push (
context ,
FadePage (
page: DoctorHomePage ( ) ,
) ,
)
context ,
FadePage (
page: DoctorHomePage ( ) ,
) ,
)
: null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myDoctor ,
imagePath: ' my_doc.svg ' ,
subTitle: TranslationBase . of ( context ) . myDoctorSubtitle ,
isEnable: projectViewModel . havePrivilege ( 6 ) ) ,
child:
MedicalProfileItem ( title: TranslationBase . of ( context ) . myDoctor , imagePath: ' my_doc.svg ' , subTitle: TranslationBase . of ( context ) . myDoctorSubtitle , isEnable: projectViewModel . havePrivilege ( 6 ) ) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 12 )
? Navigator . push ( context , FadePage ( page: HomePrescriptionsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 12 ) ? Navigator . push ( context , FadePage ( page: HomePrescriptionsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . medicines ,
imagePath: ' prescription_icon.png ' ,
@ -634,9 +579,9 @@ class Utils {
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 25 )
? Navigator . push (
context ,
FadePage ( page: VitalSignDetailsScreen ( ) ) ,
)
context ,
FadePage ( page: VitalSignDetailsScreen ( ) ) ,
)
: null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . vitalSigns ,
@ -647,9 +592,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 48 )
? Navigator . push ( context , FadePage ( page: ActiveMedicationsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 48 ) ? Navigator . push ( context , FadePage ( page: ActiveMedicationsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myMedical ,
imagePath: ' active_medications.png ' ,
@ -658,12 +601,8 @@ class Utils {
) ,
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 14 )
? Navigator . push ( context , FadePage ( page: EyeMeasurementsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 14 ) ? Navigator . push ( context , FadePage ( page: EyeMeasurementsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . eye ,
imagePath: ' eye_measurement_icon.png ' ,
@ -673,9 +612,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 22 )
? Navigator . push ( context , FadePage ( page: InsuranceCard ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 22 ) ? Navigator . push ( context , FadePage ( page: InsuranceCard ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . insurance ,
imagePath: ' insurance_card_icon.png ' ,
@ -696,9 +633,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 18 )
? Navigator . push ( context , FadePage ( page: InsuranceApproval ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 18 ) ? Navigator . push ( context , FadePage ( page: InsuranceApproval ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . insuranceApproval ,
imagePath: ' insurance_approvals_icon.png ' ,
@ -708,9 +643,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 23 )
? Navigator . push ( context , FadePage ( page: AllergiesPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 23 ) ? Navigator . push ( context , FadePage ( page: AllergiesPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . allergies ,
imagePath: ' my_allergies_icon.png ' ,
@ -720,9 +653,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 26 )
? Navigator . push ( context , FadePage ( page: MyVaccines ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 26 ) ? Navigator . push ( context , FadePage ( page: MyVaccines ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myVaccines ,
imagePath: ' my_vaccines_icon.png ' ,
@ -732,9 +663,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 20 )
? Navigator . push ( context , FadePage ( page: HomeReportPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 20 ) ? Navigator . push ( context , FadePage ( page: HomeReportPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . medical ,
imagePath: ' medical_reports_icon.png ' ,
@ -744,9 +673,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 19 )
? Navigator . push ( context , FadePage ( page: MonthlyReportsPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 19 ) ? Navigator . push ( context , FadePage ( page: MonthlyReportsPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . monthly ,
imagePath: ' monthly_reports_icon.png ' ,
@ -756,9 +683,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 16 )
? Navigator . push ( context , FadePage ( page: PatientSickLeavePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 16 ) ? Navigator . push ( context , FadePage ( page: PatientSickLeavePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . sick ,
imagePath: ' sick_leaves_icons.png ' ,
@ -768,9 +693,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 47 )
? Navigator . push ( context , FadePage ( page: MyBalancePage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 47 ) ? Navigator . push ( context , FadePage ( page: MyBalancePage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myBalance ,
imagePath: ' check-in.png ' ,
@ -787,9 +710,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 24 )
? Navigator . push ( context , FadePage ( page: MyTrackers ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 24 ) ? Navigator . push ( context , FadePage ( page: MyTrackers ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . myTrackers ,
imagePath: ' my_tracker_icon.png ' ,
@ -799,9 +720,7 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 30 )
? Navigator . push ( context , FadePage ( page: SmartWatchInstructions ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 30 ) ? Navigator . push ( context , FadePage ( page: SmartWatchInstructions ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . smartWatches ,
imagePath: ' smartwatch_icon.png ' ,
@ -811,14 +730,9 @@ class Utils {
) ) ;
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 28 )
? Navigator . push ( context , FadePage ( page: AskDoctorHomPage ( ) ) )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 28 ) ? Navigator . push ( context , FadePage ( page: AskDoctorHomPage ( ) ) ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . askYour ,
imagePath: ' ask_doctor_icon.png ' ,
subTitle: TranslationBase . of ( context ) . askYourSubtitle ,
isEnable: projectViewModel . havePrivilege ( 28 ) ) ,
title: TranslationBase . of ( context ) . askYour , imagePath: ' ask_doctor_icon.png ' , subTitle: TranslationBase . of ( context ) . askYourSubtitle , isEnable: projectViewModel . havePrivilege ( 28 ) ) ,
) ) ;
if ( projectViewModel . havePrivilege ( 32 ) | | true ) {
@ -828,15 +742,11 @@ class Utils {
if ( projectViewModel . isLogin & & userData_ ! = null ) {
String patientID = userData_ . patientID . toString ( ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
projectViewModel
. platformBridge ( )
. connectHMGInternetWifi ( patientID )
. then ( ( value ) = > { GifLoaderDialogUtils . hideDialog ( context ) } ) ;
projectViewModel . platformBridge ( ) . connectHMGInternetWifi ( patientID ) . then ( ( value ) = > { GifLoaderDialogUtils . hideDialog ( context ) } ) ;
} else {
AlertDialogBox (
context: context ,
confirmMessage:
" Please login with your account first to use this feature " ,
confirmMessage: " Please login with your account first to use this feature " ,
okText: " OK " ,
okFunction: ( ) {
AlertDialogBox . closeAlertDialog ( context ) ;
@ -853,9 +763,7 @@ class Utils {
}
medical . add ( InkWell (
onTap: ( ) = > projectViewModel . havePrivilege ( 40 )
? launch ( ' whatsapp://send?phone=18885521858&text= ' )
: null ,
onTap: ( ) = > projectViewModel . havePrivilege ( 40 ) ? launch ( ' whatsapp://send?phone=18885521858&text= ' ) : null ,
child: MedicalProfileItem (
title: TranslationBase . of ( context ) . chatbot ,
imagePath: ' insurance_approvals_icon.png ' ,
@ -867,14 +775,12 @@ class Utils {
return medical ;
}
static Widget loadNetworkImage (
{ @ required String url , BoxFit fitting = BoxFit . cover } ) {
static Widget loadNetworkImage ( { @ required String url , BoxFit fitting = BoxFit . cover } ) {
return CachedNetworkImage (
placeholderFadeInDuration: Duration ( milliseconds: 250 ) ,
fit: fitting ,
imageUrl: url ,
placeholder: ( context , url ) = >
Container ( child: Center ( child: CircularProgressIndicator ( ) ) ) ,
placeholder: ( context , url ) = > Container ( child: Center ( child: CircularProgressIndicator ( ) ) ) ,
errorWidget: ( context , url , error ) {
return Icon (
Icons . error ,
@ -885,13 +791,7 @@ class Utils {
}
}
Widget applyShadow (
{ Color color = Colors . grey ,
double shadowOpacity = 0.5 ,
double spreadRadius = 2 ,
double blurRadius = 7 ,
Offset offset = const Offset ( 2 , 2 ) ,
@ required Widget child } ) {
Widget applyShadow ( { Color color = Colors . grey , double shadowOpacity = 0.5 , double spreadRadius = 2 , double blurRadius = 7 , Offset offset = const Offset ( 2 , 2 ) , @ required Widget child } ) {
return Container (
decoration: BoxDecoration (
boxShadow: [
@ -908,8 +808,7 @@ Widget applyShadow(
}
Future < AuthenticatedUser > userData ( ) async {
var userData = AuthenticatedUser . fromJson (
await AppSharedPreferences ( ) . getObject ( MAIN_USER ) ) ;
var userData = AuthenticatedUser . fromJson ( await AppSharedPreferences ( ) . getObject ( MAIN_USER ) ) ;
return userData ;
}
@ -923,12 +822,9 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore ( { String androidPackageName , String iOSAppID } ) async {
if ( Platform . isAndroid ) {
assert ( ! ( androidPackageName = = null ) ,
" Should have valid value in androidPackageName parameter " ) ;
if ( ( await FlutterHmsGmsAvailability . isGmsAvailable ) )
launch ( " market://details?id=com.ejada.hmg " ) ;
if ( ( await FlutterHmsGmsAvailability . isHmsAvailable ) )
launch ( " appmarket://details?id=com.ejada.hmg " ) ;
assert ( ! ( androidPackageName = = null ) , " Should have valid value in androidPackageName parameter " ) ;
if ( ( await FlutterHmsGmsAvailability . isGmsAvailable ) ) launch ( " market://details?id=com.ejada.hmg " ) ;
if ( ( await FlutterHmsGmsAvailability . isHmsAvailable ) ) launch ( " appmarket://details?id=com.ejada.hmg " ) ;
} else if ( Platform . isIOS ) {
assert ( ( iOSAppID = = null ) , " Should have valid value in iOSAppID parameter " ) ;
launch ( " https://itunes.apple.com/kr/app/apple-store/ $ iOSAppID ) " ) ;