|
|
|
|
@ -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:
|
|
|
|
|
|