|
|
|
@ -101,14 +101,9 @@ class Utils {
|
|
|
|
|
static showPermissionConsentDialog(BuildContext context, String message, VoidCallback? onTap) {
|
|
|
|
|
showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (cxt) =>
|
|
|
|
|
CovidConsentDialog(
|
|
|
|
|
okTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.acceptLbl,
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.covidConsentHeader,
|
|
|
|
|
builder: (cxt) => CovidConsentDialog(
|
|
|
|
|
okTitle: TranslationBase.of(context).acceptLbl,
|
|
|
|
|
title: TranslationBase.of(context).covidConsentHeader,
|
|
|
|
|
message: message,
|
|
|
|
|
onTap: onTap!,
|
|
|
|
|
));
|
|
|
|
@ -161,10 +156,7 @@ class Utils {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, int type) {
|
|
|
|
@ -237,13 +229,9 @@ class Utils {
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointments,
|
|
|
|
|
title: TranslationBase.of(context!).myAppointments,
|
|
|
|
|
imagePath: 'appointment_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointmentsList,
|
|
|
|
|
subTitle: TranslationBase.of(context!).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
isEnable: projectViewModel!.havePrivilege(5)),
|
|
|
|
|
),
|
|
|
|
@ -290,13 +278,9 @@ class Utils {
|
|
|
|
|
: Container(),
|
|
|
|
|
])
|
|
|
|
|
: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointments,
|
|
|
|
|
title: TranslationBase.of(context!).myAppointments,
|
|
|
|
|
imagePath: 'appointment_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointmentsList,
|
|
|
|
|
subTitle: TranslationBase.of(context!).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
isEnable: projectViewModel!.havePrivilege(5),
|
|
|
|
|
),
|
|
|
|
@ -306,13 +290,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.lab,
|
|
|
|
|
title: TranslationBase.of(context).lab,
|
|
|
|
|
imagePath: 'lab_result.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.labSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).labSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
@ -320,47 +300,34 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.radiology,
|
|
|
|
|
title: TranslationBase.of(context).radiology,
|
|
|
|
|
imagePath: 'radiology.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.radiologySubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).radiologySubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(7),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medicines,
|
|
|
|
|
title: TranslationBase.of(context).medicines,
|
|
|
|
|
imagePath: 'medicine_prescription.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medicinesSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).medicinesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(12),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(25)
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(25)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(page: VitalSignDetailsScreen()),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.vitalSigns,
|
|
|
|
|
title: TranslationBase.of(context).vitalSigns,
|
|
|
|
|
imagePath: 'vital_signs.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.vitalSignsSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(25),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -370,20 +337,15 @@ class Utils {
|
|
|
|
|
if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myMedical,
|
|
|
|
|
title: TranslationBase.of(context).myMedical,
|
|
|
|
|
imagePath: 'active_medication.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myMedicalSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).myMedicalSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(48),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(6)
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(6)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
@ -392,23 +354,15 @@ class Utils {
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
child:
|
|
|
|
|
MedicalProfileItem(title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
|
|
|
|
|
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: MyInvoices())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.invoicesList,
|
|
|
|
|
title: TranslationBase.of(context).invoicesList,
|
|
|
|
|
imagePath: 'invoice_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myInvoice,
|
|
|
|
|
subTitle: TranslationBase.of(context).myInvoice,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(14),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -417,14 +371,10 @@ class Utils {
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(85) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null,
|
|
|
|
|
// onTap: () => Navigator.push(context, FadePage(page: AnicllaryOrders())),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.anicllaryOrders,
|
|
|
|
|
title: TranslationBase.of(context).anicllaryOrders,
|
|
|
|
|
imagePath: 'ancillary.svg',
|
|
|
|
|
isPngImage: false,
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myInvoice,
|
|
|
|
|
subTitle: TranslationBase.of(context).myInvoice,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(85),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -432,20 +382,15 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.eye,
|
|
|
|
|
title: TranslationBase.of(context).eye,
|
|
|
|
|
imagePath: 'eye_measurement.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.eyeSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).eyeSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(14),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(22)
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(22)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
@ -454,13 +399,9 @@ class Utils {
|
|
|
|
|
)))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.insurance,
|
|
|
|
|
title: TranslationBase.of(context).insurance,
|
|
|
|
|
imagePath: 'insurance_card.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.insuranceSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(22),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -470,19 +411,14 @@ class Utils {
|
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceUpdate()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.updateInsurance,
|
|
|
|
|
title: TranslationBase.of(context).updateInsurance,
|
|
|
|
|
imagePath: 'insurance_card.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.updateInsuranceSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).updateInsuranceSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(18)
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(18)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
@ -491,13 +427,9 @@ class Utils {
|
|
|
|
|
)))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.insuranceApproval,
|
|
|
|
|
title: TranslationBase.of(context).insuranceApproval,
|
|
|
|
|
imagePath: 'insurance_approval.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.insuranceApprovalSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(18),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -505,13 +437,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.allergies,
|
|
|
|
|
title: TranslationBase.of(context).allergies,
|
|
|
|
|
imagePath: 'allergies_diagnosed.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.allergiesSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).allergiesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(23),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -519,13 +447,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myVaccines,
|
|
|
|
|
title: TranslationBase.of(context).myVaccines,
|
|
|
|
|
imagePath: 'vaccine_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myVaccinesSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(26),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -533,13 +457,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medical,
|
|
|
|
|
title: TranslationBase.of(context).medical,
|
|
|
|
|
imagePath: 'medical_report.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medicalSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).medicalSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(20),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -547,13 +467,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.monthly,
|
|
|
|
|
title: TranslationBase.of(context).monthly,
|
|
|
|
|
imagePath: 'monthly_report.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.monthlySubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).monthlySubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(19),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -561,13 +477,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.sick,
|
|
|
|
|
title: TranslationBase.of(context).sick,
|
|
|
|
|
imagePath: 'sick_leave.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.sickSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).sickSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(16),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -575,13 +487,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myBalance,
|
|
|
|
|
title: TranslationBase.of(context).myBalance,
|
|
|
|
|
imagePath: 'balance_credit.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myBalanceSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).myBalanceSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(47),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -596,13 +504,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myTrackers,
|
|
|
|
|
title: TranslationBase.of(context).myTrackers,
|
|
|
|
|
imagePath: 'tracker.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myTrackersSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).myTrackersSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(24),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -610,13 +514,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.smartWatchesSubtitle,
|
|
|
|
|
title: TranslationBase.of(context).smartWatchesSubtitle,
|
|
|
|
|
imagePath: 'smart_watch.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.smartWatches,
|
|
|
|
|
subTitle: TranslationBase.of(context).smartWatches,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(30),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -624,20 +524,14 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.askYour, isEnable: projectViewModel.havePrivilege(28)),
|
|
|
|
|
title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(32) || true) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
showPermissionConsentDialog(context, TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.wifiPermission, () {
|
|
|
|
|
showPermissionConsentDialog(context, TranslationBase.of(context).wifiPermission, () {
|
|
|
|
|
connectWifi(projectViewModel, context);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
@ -645,13 +539,9 @@ class Utils {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.internet,
|
|
|
|
|
title: TranslationBase.of(context).internet,
|
|
|
|
|
imagePath: 'internet_connection.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.internetSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).internetSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
@ -659,13 +549,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.chatbot,
|
|
|
|
|
title: TranslationBase.of(context).chatbot,
|
|
|
|
|
imagePath: 'chatbot.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.chatbotSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).chatbotSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(40),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -735,13 +621,9 @@ class Utils {
|
|
|
|
|
child: isLogin!
|
|
|
|
|
? Stack(children: [
|
|
|
|
|
MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointments,
|
|
|
|
|
title: TranslationBase.of(context!).myAppointments,
|
|
|
|
|
imagePath: 'appointment_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointmentsList,
|
|
|
|
|
subTitle: TranslationBase.of(context!).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
isEnable: projectViewModel!.havePrivilege(5)),
|
|
|
|
|
projectViewModel.isArabic!
|
|
|
|
@ -787,13 +669,9 @@ class Utils {
|
|
|
|
|
: Container(),
|
|
|
|
|
])
|
|
|
|
|
: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointments,
|
|
|
|
|
title: TranslationBase.of(context!).myAppointments,
|
|
|
|
|
imagePath: 'appointment_list.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context!)
|
|
|
|
|
.myAppointmentsList,
|
|
|
|
|
subTitle: TranslationBase.of(context!).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
isEnable: projectViewModel!.havePrivilege(5),
|
|
|
|
|
),
|
|
|
|
@ -802,13 +680,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(10) ? Navigator.push(context, FadePage(page: LabsHomePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.lab,
|
|
|
|
|
title: TranslationBase.of(context).lab,
|
|
|
|
|
imagePath: 'lab_result.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.labSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).labSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(10),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -816,13 +690,9 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.radiology,
|
|
|
|
|
title: TranslationBase.of(context).radiology,
|
|
|
|
|
imagePath: 'radiology.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.radiologySubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).radiologySubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(7),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
@ -830,20 +700,15 @@ class Utils {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medicines,
|
|
|
|
|
title: TranslationBase.of(context).medicines,
|
|
|
|
|
imagePath: 'medicine_prescription.svg',
|
|
|
|
|
subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.medicinesSubtitle,
|
|
|
|
|
subTitle: TranslationBase.of(context).medicinesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(12),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(6)
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(6)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
@ -852,11 +717,7 @@ class Utils {
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
child:
|
|
|
|
|
MedicalProfileItem(title: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
|
|
|
|
|
MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
return medical;
|
|
|
|
@ -896,11 +757,7 @@ class Utils {
|
|
|
|
|
SizedBox(height: 6),
|
|
|
|
|
Text(
|
|
|
|
|
text,
|
|
|
|
|
style: TextStyle(fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
height: 18 / 12),
|
|
|
|
|
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 5),
|
|
|
|
|
if (showDivider)
|
|
|
|
@ -913,7 +770,7 @@ class Utils {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel mProjectViewModel}) {
|
|
|
|
|
static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel? mProjectViewModel}) {
|
|
|
|
|
ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context);
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -974,13 +831,32 @@ class Utils {
|
|
|
|
|
return crypto.md5.convert(utf8.encode(input)).toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static String generateSignature() {
|
|
|
|
|
static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) {
|
|
|
|
|
bool isVidaPlus = false;
|
|
|
|
|
projectViewModel.vidaPlusProjectList.forEach((element) {
|
|
|
|
|
if (element.projectID == projectID) {
|
|
|
|
|
isVidaPlus = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return isVidaPlus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool isHMCProject(ProjectViewModel projectViewModel, int projectID) {
|
|
|
|
|
bool isHMCProject = false;
|
|
|
|
|
projectViewModel.hMCProjectListModel.forEach((element) {
|
|
|
|
|
if (element.projectID == projectID) {
|
|
|
|
|
isHMCProject = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return isHMCProject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// static String generateSignature() {
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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: [
|
|
|
|
@ -1009,7 +885,7 @@ extension IndexedIterable<E> on Iterable<E> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openAppStore({String androidPackageName, String iOSAppID, bool isHuawei = false}) async {
|
|
|
|
|
openAppStore({String? androidPackageName, String? iOSAppID, bool isHuawei = false}) async {
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
|
|
|
|
|
if (isHuawei) {
|
|
|
|
@ -1023,7 +899,7 @@ openAppStore({String androidPackageName, String iOSAppID, bool isHuawei = false}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String labelFrom({@required String className}) {
|
|
|
|
|
String labelFrom({required String className}) {
|
|
|
|
|
RegExp exp = RegExp(r'(?<=[a-z])[A-Z]');
|
|
|
|
|
|
|
|
|
|
String result = className.replaceAllMapped(exp, (m) {
|
|
|
|
|