Design inhancment

merge-requests/319/head
hussam al-habibeh 5 years ago
parent 0f15732728
commit ae17998e0a

@ -360,12 +360,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
.width *
0.550,
child: TextFields(
// inputFormatters: [
// LengthLimitingTextInputFormatter(
// 4),
// WhitelistingTextInputFormatter
// .digitsOnly
// ],
inputFormatters: [
LengthLimitingTextInputFormatter(
4),
// WhitelistingTextInputFormatter
// .digitsOnly
],
hintText:
TranslationBase.of(context)
.strength,

@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<MedicineViewModel>(
onModelReady: (model) async {
await model.getMedicationList();
//await model.getMedicationList();
await model.getMedicationStrength();
await model.getMedicationDuration();
await model.getMedicationRoute();
@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
inputFormatters: [
LengthLimitingTextInputFormatter(
4),
WhitelistingTextInputFormatter
.digitsOnly
// WhitelistingTextInputFormatter
// .digitsOnly
],
hintText: widget.doseStreangth,
fontSize: 15.0,
controller: strengthController,
keyboardType:
TextInputType.number,
keyboardType: TextInputType
.numberWithOptions(
decimal: true,
),
onChanged: (String value) {
setState(() {
strengthChar = value.length;
@ -700,6 +703,27 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
title: 'update prescription'
.toUpperCase(),
onPressed: () {
if (int.parse(
strengthController.text) >
1000) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (int.parse(strengthController
.text) ==
0) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
}
if (strengthController
.text.length >
4) {
DrAppToastMsg.showErrorToast(
"Streangth can't be zero");
return;
}
updatePrescription(
newStartDate: selectedDate,
newDoseStreangth:

Loading…
Cancel
Save