Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp

merge-requests/328/head
Sultan Khan 5 years ago
commit 3c2539d5b9

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
//const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -471,6 +471,8 @@ const GET_ANCILLARY_ORDERS_DETAILS =
//Pharmacy wishlist //Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
// pharmacy // pharmacy
const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
@ -592,8 +594,6 @@ const FILTERED_PRODUCTS = 'products?categoryids=';
const GET_DOCTOR_LIST_CALCULATION = const GET_DOCTOR_LIST_CALCULATION =
"Services/Doctors.svc/REST/GetCallculationDoctors"; "Services/Doctors.svc/REST/GetCallculationDoctors";
const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -42,39 +42,39 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget { class NewTextFields extends StatefulWidget {
NewTextFields( NewTextFields(
{Key key, {Key key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
this.autoFocus, this.autoFocus,
this.onChanged, this.onChanged,
this.initialValue, this.initialValue,
this.minLines, this.minLines,
this.maxLines, this.maxLines,
this.inputFormatters, this.inputFormatters,
this.padding, this.padding,
this.focus = false, this.focus = false,
this.maxLengthEnforced = true, this.maxLengthEnforced = true,
this.suffixIconColor, this.suffixIconColor,
this.inputAction, this.inputAction,
this.onSubmit, this.onSubmit,
this.keepPadding = true, this.keepPadding = true,
this.textCapitalization = TextCapitalization.none, this.textCapitalization = TextCapitalization.none,
this.controller, this.controller,
this.keyboardType, this.keyboardType,
this.validator, this.validator,
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly: false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.autoValidate = false, this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true,this.counterText=""}) this.isEnabled = true,this.counterText=""})
: super(key: key); : super(key: key);
final String hintText; final String hintText;
@ -171,10 +171,10 @@ class _NewTextFieldsState extends State<NewTextFields> {
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction == TextInputAction.next onFieldSubmitted: widget.inputAction == TextInputAction.next
? (widget.onSubmit != null ? (widget.onSubmit != null
? widget.onSubmit ? widget.onSubmit
: (val) { : (val) {
_focusNode.nextFocus(); _focusNode.nextFocus();
}) })
: widget.onSubmit, : widget.onSubmit,
textInputAction: widget.inputAction, textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1, minLines: widget.minLines ?? 1,
@ -194,15 +194,15 @@ class _NewTextFieldsState extends State<NewTextFields> {
fontSize: widget.fontSize, fontWeight: widget.fontWeight), fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
WhitelistingTextInputFormatter.digitsOnly, WhitelistingTextInputFormatter.digitsOnly,
_mobileFormatter, _mobileFormatter,
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hintText, labelText: widget.hintText,
counterText: widget.counterText, counterText: widget.counterText,
labelStyle: labelStyle:
TextStyle(color: Theme.of(context).textTheme.bodyText1.color), TextStyle(color: Theme.of(context).textTheme.bodyText1.color),
errorBorder: OutlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Theme.of(context).errorColor.withOpacity(0.5), color: Theme.of(context).errorColor.withOpacity(0.5),

@ -27,13 +27,13 @@ class AddWeightPage extends StatefulWidget {
AddWeightPage( AddWeightPage(
{Key key, {Key key,
this.model, this.model,
this.isUpdate = false, this.isUpdate = false,
this.dayWeightDate, this.dayWeightDate,
this.lineItemNo, this.lineItemNo,
this.weightValue, this.weightValue,
this.measureTimeSelectedType, this.measureTimeSelectedType,
this.weightUnit}) this.weightUnit})
: super(key: key); : super(key: key);
@override @override
@ -79,39 +79,39 @@ class _AddWeightPageState extends State<AddWeightPage> {
? TranslationBase.of(context).update ? TranslationBase.of(context).update
: TranslationBase.of(context).add, : 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
.deleteWeightResult(lineItemNo: widget.lineItemNo) .deleteWeightResult(lineItemNo: widget.lineItemNo)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal) if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.model.error); message: widget.model.error);
else else
Navigator.pop(context); Navigator.pop(context);
}).catchError((e) { }).catchError((e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error); AppToast.showErrorToast(message: widget.model.error);
}); });
}, },
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}, },
) )
] ]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -246,12 +246,12 @@ class _AddWeightPageState extends State<AddWeightPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.updateWeightResult( .updateWeightResult(
weightDate: weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: weightMeasured:
_weightValueController.text.toString(), _weightValueController.text.toString(),
weightUnit: weightUnit, weightUnit: weightUnit,
lineItemNo: widget.lineItemNo) lineItemNo: widget.lineItemNo)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error) if (widget.model.state == ViewState.Error)
@ -263,7 +263,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
widget.model widget.model
.addWeightResult( .addWeightResult(
weightDate: weightDate:
'${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00', '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(), weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit, weightUnit: weightUnit,
) )

@ -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
@ -42,10 +42,12 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> { class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController(); TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController(); TextEditingController _bloodDiastolicValueController =
TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 1;
bool isButtonDisabled = false;
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Left', 'Left',
'Right', 'Right',
@ -69,6 +71,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType); measuredArm = measureTimeArList.indexOf(widget.measureTimeSelectedType);
_bloodSystolicValueController.text = widget.bloodSystolicValue; _bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue; _bloodDiastolicValueController.text = widget.bloodDiastolicValue;
validateForm();
} }
} }
@ -78,38 +81,44 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate
? 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.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { widget.model
GifLoaderDialogUtils.hideDialog(context); .deactivateDiabeticStatus(
if (widget.model.state == ViewState.ErrorLocal) lineItemNo: widget.lineItemNo)
AppToast.showErrorToast(message: widget.model.error); .then((value) {
else GifLoaderDialogUtils.hideDialog(context);
Navigator.pop(context); if (widget.model.state == ViewState.ErrorLocal)
}).catchError((e) { AppToast.showErrorToast(
GifLoaderDialogUtils.hideDialog(context); message: widget.model.error);
AppToast.showErrorToast(message: widget.model.error); else
}); Navigator.pop(context);
}, }).catchError((e) {
cancelFunction: () => {}); GifLoaderDialogUtils.hideDialog(context);
dialog.showAlertDialog(context); AppToast.showErrorToast(message: widget.model.error);
}, });
) },
] cancelFunction: () => {});
dialog.showAlertDialog(context);
},
)
]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -124,6 +133,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
hintText: TranslationBase.of(context).systolicAdd, hintText: TranslationBase.of(context).systolicAdd,
controller: _bloodSystolicValueController, controller: _bloodSystolicValueController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -132,19 +143,25 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
hintText: TranslationBase.of(context).diastolicAdd, hintText: TranslationBase.of(context).diastolicAdd,
controller: _bloodDiastolicValueController, controller: _bloodDiastolicValueController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
maxLength: 3,
onChanged: (value) => validateForm(),
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeEnList
: measureTimeArList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -166,18 +183,22 @@ 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,
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType); 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(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -192,22 +213,30 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true,
setState( onConfirm: (date) {
() { setState(
timeSugarDate = date; () {
timeSugarDate = date;
},
);
}, },
); currentTime: timeSugarDate,
}, currentTime: timeSugarDate, locale: projectViewModel.localeType); 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(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())], children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -225,17 +254,23 @@ 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
? Colors.grey[900]
: Colors.grey,
onTap: () async { onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) { if (_bloodSystolicValueController.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: _bloodDiastolicValueController.text.toString(), diastolicPressure:
systolicePressure: _bloodSystolicValueController.text.toString(), _bloodDiastolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm, measuredArm: measuredArm,
) )
.then((value) { .then((value) {
@ -275,9 +310,43 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
setState(() { setState(() {
measureTimeSelectedType = value; measureTimeSelectedType = value;
measuredArm = list.indexOf(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;
// });
// }
}
} }

@ -27,13 +27,13 @@ class AddBloodSugarPage extends StatefulWidget {
AddBloodSugarPage( AddBloodSugarPage(
{Key key, {Key key,
this.bloodSugarDate, this.bloodSugarDate,
this.measureUnitSelectedType, this.measureUnitSelectedType,
this.isUpdate = false, this.isUpdate = false,
this.measuredTime, this.measuredTime,
this.bloodSugarValue, this.bloodSugarValue,
this.lineItemNo, this.lineItemNo,
this.bloodSugarViewMode}) this.bloodSugarViewMode})
: super(key: key); : super(key: key);
@override @override
@ -99,42 +99,42 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
? TranslationBase.of(context).update ? TranslationBase.of(context).update
: TranslationBase.of(context).add, : 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.bloodSugarViewMode widget.bloodSugarViewMode
.deactivateDiabeticStatus( .deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo) lineItemNo: widget.lineItemNo)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal) ViewState.ErrorLocal)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
}).catchError((e) { }).catchError((e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
}); });
}, },
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}, },
) )
] ]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -186,10 +186,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
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, currentTime: bloodSugarDate,
locale: projectViewModel.localeType); locale: projectViewModel.localeType);
}, },
@ -216,10 +216,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) { onConfirm: (date) {
setState(() { setState(() {
timeSugarDate = date; timeSugarDate = date;
}); });
}, },
currentTime: timeSugarDate, currentTime: timeSugarDate,
locale: projectViewModel.localeType); locale: projectViewModel.localeType);
}, },
@ -288,13 +288,13 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode widget.bloodSugarViewMode
.updateDiabtecResult( .updateDiabtecResult(
month: bloodSugarDate, month: bloodSugarDate,
hour: timeSugarDate, hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType, diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime, measuredTime: measuredTime,
lineItemNo: widget.lineItemNo, lineItemNo: widget.lineItemNo,
bloodSugerResult: bloodSugerResult:
_bloodSugarValueController.text.toString()) _bloodSugarValueController.text.toString())
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state ==
@ -310,9 +310,9 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
diabtecUnit: measureUnitSelectedType, diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime, measuredTime: measuredTime,
bloodSugerResult: bloodSugerResult:
_bloodSugarValueController.text.toString(), _bloodSugarValueController.text.toString(),
bloodSugerDateChart: bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
) )
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

Loading…
Cancel
Save