|
|
|
|
@ -195,9 +195,7 @@ class Utils {
|
|
|
|
|
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(
|
|
|
|
|
@ -206,26 +204,27 @@ class Utils {
|
|
|
|
|
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)),
|
|
|
|
|
),
|
|
|
|
|
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)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
])
|
|
|
|
|
: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myAppointments,
|
|
|
|
|
imagePath: 'my_appointment_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myAppointmentsList,
|
|
|
|
|
hasBadge: true,isEnable: projectViewModel.havePrivilege(5),
|
|
|
|
|
),
|
|
|
|
|
])
|
|
|
|
|
: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myAppointments,
|
|
|
|
|
imagePath: 'my_appointment_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(5),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
if (projectViewModel.havePrivilege(10)) {
|
|
|
|
|
@ -239,11 +238,9 @@ class Utils {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>projectViewModel.havePrivilege(7)
|
|
|
|
|
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
|
|
|
|
|
: null,
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).radiology,
|
|
|
|
|
imagePath: 'radiology_icon.png',
|
|
|
|
|
@ -253,9 +250,8 @@ class Utils {
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
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',
|
|
|
|
|
@ -279,11 +275,9 @@ class Utils {
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>projectViewModel.havePrivilege(48)
|
|
|
|
|
? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
|
|
|
|
|
: null,
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myMedical,
|
|
|
|
|
imagePath: 'active_medications.png',
|
|
|
|
|
@ -309,9 +303,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',
|
|
|
|
|
@ -321,9 +314,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',
|
|
|
|
|
@ -344,9 +335,8 @@ 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',
|
|
|
|
|
@ -356,9 +346,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',
|
|
|
|
|
@ -368,9 +356,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',
|
|
|
|
|
@ -380,9 +366,8 @@ 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',
|
|
|
|
|
@ -392,9 +377,8 @@ 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',
|
|
|
|
|
@ -404,9 +388,8 @@ 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',
|
|
|
|
|
@ -416,9 +399,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',
|
|
|
|
|
@ -436,9 +417,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',
|
|
|
|
|
@ -448,9 +427,8 @@ 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',
|
|
|
|
|
@ -460,9 +438,8 @@ 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',
|
|
|
|
|
@ -501,9 +478,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',
|
|
|
|
|
@ -515,8 +490,7 @@ 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,
|
|
|
|
|
@ -569,8 +543,7 @@ 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");
|
|
|
|
|
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) {
|
|
|
|
|
|