jira bugs

merge-update-with-lab-changes
hussam al-habibeh 5 years ago
parent 6dc0d89f61
commit d5c76b5400

@ -27,13 +27,13 @@ class AddBloodPressurePage extends StatefulWidget {
const AddBloodPressurePage( const AddBloodPressurePage(
{Key key, {Key key,
this.bloodSugarDate, this.bloodSugarDate,
this.measureTimeSelectedType, this.measureTimeSelectedType,
this.isUpdate = false, this.isUpdate = false,
this.lineItemNo, this.lineItemNo,
this.model, this.model,
this.bloodSystolicValue, this.bloodSystolicValue,
this.bloodDiastolicValue}) this.bloodDiastolicValue})
: super(key: key); : super(key: key);
@override @override
@ -80,44 +80,38 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate appBarIcons: widget.isUpdate
? [ ? [
IconButton( IconButton(
icon: Icon(Icons.delete), icon: Icon(Icons.delete),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: 'Remove this measure', confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel, cancelText: TranslationBase.of(context).cancel,
okFunction: () async { okFunction: () async {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
.deactivateDiabeticStatus( GifLoaderDialogUtils.hideDialog(context);
lineItemNo: widget.lineItemNo) if (widget.model.state == ViewState.ErrorLocal)
.then((value) { AppToast.showErrorToast(message: widget.model.error);
GifLoaderDialogUtils.hideDialog(context); else
if (widget.model.state == ViewState.ErrorLocal) Navigator.pop(context);
AppToast.showErrorToast( }).catchError((e) {
message: widget.model.error); GifLoaderDialogUtils.hideDialog(context);
else AppToast.showErrorToast(message: widget.model.error);
Navigator.pop(context); });
}).catchError((e) { },
GifLoaderDialogUtils.hideDialog(context); cancelFunction: () => {});
AppToast.showErrorToast(message: widget.model.error); dialog.showAlertDialog(context);
}); },
}, )
cancelFunction: () => {}); ]
dialog.showAlertDialog(context);
},
)
]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -156,9 +150,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -180,22 +172,18 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showTitleActions: true, showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1), minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
setState( setState(
() { () {
bloodSugarDate = date; bloodSugarDate = date;
},
);
}, },
currentTime: bloodSugarDate, );
locale: projectViewModel.localeType); }, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -210,30 +198,22 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
onConfirm: (date) { setState(
setState( () {
() { timeSugarDate = date;
timeSugarDate = date;
},
);
}, },
currentTime: timeSugarDate, );
locale: projectViewModel.localeType); }, currentTime: timeSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -251,23 +231,18 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
loading: widget.model.state == ViewState.BusyLocal, loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white, textColor: Colors.white,
color: isButtonDisabled color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
? Colors.grey[900]
: Colors.grey,
onTap: () async { onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: diastolicPressure: _bloodDiastolicValueController.text.toString(),
_bloodDiastolicValueController.text.toString(), systolicePressure: _bloodSystolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm, measuredArm: measuredArm,
) )
.then((value) { .then((value) {
@ -315,7 +290,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 && _bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) { _bloodDiastolicValueController.text.length > 0) {
@ -345,5 +320,4 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
// }); // });
// } // }
} }
} }

@ -195,9 +195,7 @@ class Utils {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
@ -206,26 +204,27 @@ class Utils {
subTitle: TranslationBase.of(context).myAppointmentsList, subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true, hasBadge: true,
isEnable: projectViewModel.havePrivilege(5)), isEnable: projectViewModel.havePrivilege(5)),
Positioned( Positioned(
right: 0.0, right: 0.0,
child: Badge( child: Badge(
toAnimate: false, toAnimate: false,
position: BadgePosition.topEnd(), position: BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)),
),
), ),
), ),
]) ),
: MedicalProfileItem( ])
title: TranslationBase.of(context).myAppointments, : MedicalProfileItem(
imagePath: 'my_appointment_icon.png', title: TranslationBase.of(context).myAppointments,
subTitle: TranslationBase.of(context).myAppointmentsList, imagePath: 'my_appointment_icon.png',
hasBadge: true,isEnable: projectViewModel.havePrivilege(5), subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
), ),
)); ));
if (projectViewModel.havePrivilege(10)) { if (projectViewModel.havePrivilege(10)) {
@ -239,11 +238,9 @@ class Utils {
)); ));
} }
medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () =>projectViewModel.havePrivilege(7) projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png', imagePath: 'radiology_icon.png',
@ -253,9 +250,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () =>
? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png', imagePath: 'prescription_icon.png',
@ -279,11 +275,9 @@ class Utils {
), ),
)); ));
medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () =>projectViewModel.havePrivilege(48) projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png', imagePath: 'active_medications.png',
@ -309,9 +303,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () =>
? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png', imagePath: 'eye_measurement_icon.png',
@ -321,9 +314,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null,
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png', imagePath: 'insurance_card_icon.png',
@ -344,9 +335,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) onTap: () =>
? Navigator.push(context, FadePage(page: InsuranceApproval())) projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -356,9 +346,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23) onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png', imagePath: 'my_allergies_icon.png',
@ -368,9 +356,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26) onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines, title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png', imagePath: 'my_vaccines_icon.png',
@ -380,9 +366,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) onTap: () =>
? Navigator.push(context, FadePage(page: HomeReportPage())) projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
@ -392,9 +377,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) onTap: () =>
? Navigator.push(context, FadePage(page: MonthlyReportsPage())) projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png', imagePath: 'monthly_reports_icon.png',
@ -404,9 +388,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) onTap: () =>
? Navigator.push(context, FadePage(page: PatientSickLeavePage())) projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png', imagePath: 'sick_leaves_icons.png',
@ -416,9 +399,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47) onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance, title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png', imagePath: 'check-in.png',
@ -436,9 +417,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers, title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png', imagePath: 'my_tracker_icon.png',
@ -448,9 +427,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30) onTap: () =>
? Navigator.push(context, FadePage(page: SmartWatchInstructions())) projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png', imagePath: 'smartwatch_icon.png',
@ -460,9 +438,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28) onTap: () =>
? Navigator.push(context, FadePage(page: AskDoctorHomPage())) projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).askYour, title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png', imagePath: 'ask_doctor_icon.png',
@ -501,9 +478,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40) onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot, title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -515,8 +490,7 @@ class Utils {
return medical; return medical;
} }
static Widget loadNetworkImage( static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) {
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
@ -569,8 +543,7 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
"Should have valid value in androidPackageName parameter");
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {

Loading…
Cancel
Save