|
|
|
|
@ -48,8 +48,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
int measuredArm = 1;
|
|
|
|
|
bool isButtonDisabled = false;
|
|
|
|
|
final List<String> measureTimeEnList = [
|
|
|
|
|
'Left arm ',
|
|
|
|
|
'Right arm',
|
|
|
|
|
'Left Arm ',
|
|
|
|
|
'Right Arm',
|
|
|
|
|
];
|
|
|
|
|
final List<String> measureTimeArList = [
|
|
|
|
|
'الذراع الأيسر',
|
|
|
|
|
@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
|
|
|
|
|
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
@ -224,40 +224,44 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
bottomSheet: Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: MediaQuery.of(context).size.width * 0.2,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(15.0),
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
loading: widget.model.state == ViewState.BusyLocal,
|
|
|
|
|
label: TranslationBase.of(context).save.toUpperCase(),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.10,
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
SecondaryButton(
|
|
|
|
|
loading: widget.model.state == ViewState.BusyLocal,
|
|
|
|
|
label: TranslationBase.of(context).save.toUpperCase(),
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
|
|
widget.model
|
|
|
|
|
.addORUpdateDiabtecResult(
|
|
|
|
|
isUpdate: widget.isUpdate,
|
|
|
|
|
bloodPressureDate:
|
|
|
|
|
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
|
|
|
|
|
diastolicPressure: _bloodDiastolicValueController.text.toString(),
|
|
|
|
|
systolicePressure: _bloodSystolicValueController.text.toString(),
|
|
|
|
|
measuredArm: measuredArm,
|
|
|
|
|
)
|
|
|
|
|
.then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (widget.model.state == ViewState.BusyLocal)
|
|
|
|
|
AppToast.showErrorToast(message: widget.model.error);
|
|
|
|
|
else
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
;
|
|
|
|
|
}).catchError((e) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: widget.model.error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
widget.model
|
|
|
|
|
.addORUpdateDiabtecResult(
|
|
|
|
|
isUpdate: widget.isUpdate,
|
|
|
|
|
bloodPressureDate:
|
|
|
|
|
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
|
|
|
|
|
diastolicPressure: _bloodDiastolicValueController.text.toString(),
|
|
|
|
|
systolicePressure: _bloodSystolicValueController.text.toString(),
|
|
|
|
|
measuredArm: measuredArm,
|
|
|
|
|
)
|
|
|
|
|
.then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (widget.model.state == ViewState.BusyLocal)
|
|
|
|
|
AppToast.showErrorToast(message: widget.model.error);
|
|
|
|
|
else
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
;
|
|
|
|
|
}).catchError((e) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: widget.model.error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|