|
|
|
@ -209,49 +209,44 @@ class Utils {
|
|
|
|
|
bool isLogin,
|
|
|
|
|
count}) {
|
|
|
|
|
List<Widget> medical = List();
|
|
|
|
|
if (projectViewModel.havePrivilege(5)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: MyAppointments(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: isLogin
|
|
|
|
|
? Stack(children: [
|
|
|
|
|
MedicalProfileItem(
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
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)),
|
|
|
|
|
),
|
|
|
|
|
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)),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
])
|
|
|
|
|
: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myAppointments,
|
|
|
|
|
imagePath: 'my_appointment_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myAppointmentsList,
|
|
|
|
|
hasBadge: true,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
: 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)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
|
|
|
|
@ -263,106 +258,97 @@ class Utils {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(7)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
Navigator.push(context, FadePage(page: RadiologyHomePage())),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).radiology,
|
|
|
|
|
imagePath: 'radiology_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).radiologySubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
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',
|
|
|
|
|
subTitle: TranslationBase.of(context).radiologySubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(7),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(12)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: HomePrescriptionsPage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).medicines,
|
|
|
|
|
imagePath: 'prescription_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).medicinesSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(12)
|
|
|
|
|
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).medicines,
|
|
|
|
|
imagePath: 'prescription_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).medicinesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(12),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(25)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: VitalSignDetailsScreen(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).vitalSigns,
|
|
|
|
|
imagePath: 'vital_signs.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(25)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(page: VitalSignDetailsScreen()),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).vitalSigns,
|
|
|
|
|
imagePath: 'vital_signs.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(25),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(48)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () =>
|
|
|
|
|
Navigator.push(context, FadePage(page: ActiveMedicationsPage())),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myMedical,
|
|
|
|
|
imagePath: 'active_medications.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myMedicalSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
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',
|
|
|
|
|
subTitle: TranslationBase.of(context).myMedicalSubtitle,
|
|
|
|
|
isEnable: false,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(6)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: DoctorHomePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(6)
|
|
|
|
|
? Navigator.push(
|
|
|
|
|
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)),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(14)
|
|
|
|
|
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).eye,
|
|
|
|
|
imagePath: 'eye_measurement_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).eyeSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(14),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(22)
|
|
|
|
|
? Navigator.push(context, FadePage(page: InsuranceCard()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).insurance,
|
|
|
|
|
imagePath: 'insurance_card_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(22),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(14)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: EyeMeasurementsPage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).eye,
|
|
|
|
|
imagePath: 'eye_measurement_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).eyeSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
if (projectViewModel.havePrivilege(22)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceCard()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).insurance,
|
|
|
|
|
imagePath: 'insurance_card_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceUpdate()));
|
|
|
|
@ -374,137 +360,132 @@ class Utils {
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(18)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceApproval()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).insuranceApproval,
|
|
|
|
|
imagePath: 'insurance_approvals_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(18)
|
|
|
|
|
? Navigator.push(context, FadePage(page: InsuranceApproval()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).insuranceApproval,
|
|
|
|
|
imagePath: 'insurance_approvals_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(18),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(23)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())),
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).allergies,
|
|
|
|
|
imagePath: 'my_allergies_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).allergiesSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(23)
|
|
|
|
|
? Navigator.push(context, FadePage(page: AllergiesPage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).allergies,
|
|
|
|
|
imagePath: 'my_allergies_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).allergiesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(23),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(26)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: MyVaccines()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myVaccines,
|
|
|
|
|
imagePath: 'my_vaccines_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
if (projectViewModel.havePrivilege(20))
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: HomeReportPage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).medical,
|
|
|
|
|
imagePath: 'medical_reports_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).medicalSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(26)
|
|
|
|
|
? Navigator.push(context, FadePage(page: MyVaccines()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myVaccines,
|
|
|
|
|
imagePath: 'my_vaccines_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(26),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(19)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: MonthlyReportsPage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).monthly,
|
|
|
|
|
imagePath: 'monthly_reports_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).monthlySubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(20)
|
|
|
|
|
? Navigator.push(context, FadePage(page: HomeReportPage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).medical,
|
|
|
|
|
imagePath: 'medical_reports_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).medicalSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(20),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(16)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: PatientSickLeavePage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).sick,
|
|
|
|
|
imagePath: 'sick_leaves_icons.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).sickSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(19)
|
|
|
|
|
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).monthly,
|
|
|
|
|
imagePath: 'monthly_reports_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).monthlySubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(19),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(47)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: MyBalancePage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myBalance,
|
|
|
|
|
imagePath: 'check-in.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myBalanceSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(16)
|
|
|
|
|
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).sick,
|
|
|
|
|
imagePath: 'sick_leaves_icons.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).sickSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(16),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(61)) {
|
|
|
|
|
medical.add(MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).patientCall,
|
|
|
|
|
imagePath: 'medical_history_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).patientCallSubtitle,
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(47)
|
|
|
|
|
? Navigator.push(context, FadePage(page: MyBalancePage()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myBalance,
|
|
|
|
|
imagePath: 'check-in.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myBalanceSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(47),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(24)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: MyTrackers()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myTrackers,
|
|
|
|
|
imagePath: 'my_tracker_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myTrackersSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
if (projectViewModel.havePrivilege(30))
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).smartWatches,
|
|
|
|
|
imagePath: 'smartwatch_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
medical.add(MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).patientCall,
|
|
|
|
|
imagePath: 'medical_history_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).patientCallSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(61),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(28)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(context, FadePage(page: AskDoctorHomPage()));
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(24)
|
|
|
|
|
? Navigator.push(context, FadePage(page: MyTrackers()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).myTrackers,
|
|
|
|
|
imagePath: 'my_tracker_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).myTrackersSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(24),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(30)
|
|
|
|
|
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).smartWatches,
|
|
|
|
|
imagePath: 'smartwatch_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(30),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
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)),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(32) || true) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
@ -536,43 +517,46 @@ class Utils {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (projectViewModel.havePrivilege(40)) {
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
launch('whatsapp://send?phone=18885521858&text=');
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).chatbot,
|
|
|
|
|
imagePath: 'insurance_approvals_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).chatbotSubtitle,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
medical.add(InkWell(
|
|
|
|
|
onTap: () => projectViewModel.havePrivilege(40)
|
|
|
|
|
? launch('whatsapp://send?phone=18885521858&text=')
|
|
|
|
|
: null,
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).chatbot,
|
|
|
|
|
imagePath: 'insurance_approvals_icon.png',
|
|
|
|
|
subTitle: TranslationBase.of(context).chatbotSubtitle,
|
|
|
|
|
isEnable: projectViewModel.havePrivilege(40),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
errorWidget: (context, url, error){
|
|
|
|
|
return Icon(Icons.error, color: Colors.red, size: 50,);
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
placeholderFadeInDuration: Duration(milliseconds: 250),
|
|
|
|
|
fit: fitting,
|
|
|
|
|
imageUrl: url,
|
|
|
|
|
placeholder: (context, url) =>
|
|
|
|
|
Container(child: Center(child: CircularProgressIndicator())),
|
|
|
|
|
errorWidget: (context, url, error) {
|
|
|
|
|
return Icon(
|
|
|
|
|
Icons.error,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
size: 50,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: [
|
|
|
|
@ -588,7 +572,6 @@ Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, doub
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<AuthenticatedUser> userData() async {
|
|
|
|
|
var userData = AuthenticatedUser.fromJson(
|
|
|
|
|
await AppSharedPreferences().getObject(MAIN_USER));
|
|
|
|
@ -603,15 +586,15 @@ 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))
|
|
|
|
|
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))
|
|
|
|
|
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
|
|
|
|
|
launch("appmarket://details?id=com.ejada.hmg");
|
|
|
|
|
|
|
|
|
|
}else if(Platform.isIOS){
|
|
|
|
|
} else if (Platform.isIOS) {
|
|
|
|
|
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
|
|
|
|
|
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
|
|
|
|
|
}
|
|
|
|
|