|
|
|
|
@ -46,7 +46,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
DateTime bloodSugarDate = DateTime.now();
|
|
|
|
|
DateTime timeSugarDate = DateTime.now();
|
|
|
|
|
int measuredArm = 1;
|
|
|
|
|
bool isButtonDisabled = false;
|
|
|
|
|
final List<String> measureTimeEnList = [
|
|
|
|
|
'Left',
|
|
|
|
|
'Right',
|
|
|
|
|
@ -70,7 +69,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
|
|
|
|
|
_bloodSystolicValueController.text = widget.bloodSystolicValue;
|
|
|
|
|
_bloodDiastolicValueController.text = widget.bloodDiastolicValue;
|
|
|
|
|
validateForm();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -80,13 +78,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
|
|
|
|
|
=======
|
|
|
|
|
appBarTitle: widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context).update
|
|
|
|
|
: TranslationBase.of(context).add,
|
|
|
|
|
>>>>>>> bcb4f487854a894a41a6578a08e0e8f306120033
|
|
|
|
|
appBarIcons: widget.isUpdate
|
|
|
|
|
? [
|
|
|
|
|
IconButton(
|
|
|
|
|
@ -102,21 +94,10 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (widget.model.state == ViewState.ErrorLocal)
|
|
|
|
|
AppToast.showErrorToast(message: widget.model.error);
|
|
|
|
|
=======
|
|
|
|
|
widget.model
|
|
|
|
|
.deactivateDiabeticStatus(
|
|
|
|
|
lineItemNo: widget.lineItemNo)
|
|
|
|
|
.then((value) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (widget.model.state == ViewState.ErrorLocal)
|
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
|
message: widget.model.error);
|
|
|
|
|
>>>>>>> bcb4f487854a894a41a6578a08e0e8f306120033
|
|
|
|
|
else
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}).catchError((e) {
|
|
|
|
|
@ -143,8 +124,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
hintText: TranslationBase.of(context).systolicAdd,
|
|
|
|
|
controller: _bloodSystolicValueController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
maxLength: 3,
|
|
|
|
|
onChanged: (value) => validateForm(),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
@ -153,15 +132,13 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
hintText: TranslationBase.of(context).diastolicAdd,
|
|
|
|
|
controller: _bloodDiastolicValueController,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
maxLength: 3,
|
|
|
|
|
onChanged: (value) => validateForm(),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
|
|
|
|
|
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(12),
|
|
|
|
|
@ -248,9 +225,6 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
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);
|
|
|
|
|
@ -301,43 +275,9 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
|
|
|
|
|
setState(() {
|
|
|
|
|
measureTimeSelectedType = value;
|
|
|
|
|
measuredArm = list.indexOf(value);
|
|
|
|
|
validateForm();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void validateForm() {
|
|
|
|
|
print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString());
|
|
|
|
|
if (measureTimeSelectedType != 'Left Arm' &&
|
|
|
|
|
_bloodSystolicValueController.text.length > 0 &&
|
|
|
|
|
_bloodDiastolicValueController.text.length > 0) {
|
|
|
|
|
setState(() {
|
|
|
|
|
isButtonDisabled = true;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
setState(() {
|
|
|
|
|
isButtonDisabled = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// if(measureTimeSelectedType == 'Left Arm'){
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isButtonDisabled = false;
|
|
|
|
|
// });
|
|
|
|
|
// }else if(_bloodSystolicValueController.text.length < 0){
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isButtonDisabled = false;
|
|
|
|
|
// });
|
|
|
|
|
// }else if(_bloodDiastolicValueController.text.length < 0){
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isButtonDisabled = false;
|
|
|
|
|
// });
|
|
|
|
|
// }else{
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isButtonDisabled = true;
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|