|
|
|
|
@ -445,85 +445,39 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
// height: MediaQuery.of(context)
|
|
|
|
|
// .size
|
|
|
|
|
// .height *
|
|
|
|
|
// 0.02,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
width: MediaQuery.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.35,
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
isPrscription: true,
|
|
|
|
|
inputFormatters: [
|
|
|
|
|
LengthLimitingTextInputFormatter(
|
|
|
|
|
5),
|
|
|
|
|
// WhitelistingTextInputFormatter
|
|
|
|
|
// .digitsOnly
|
|
|
|
|
],
|
|
|
|
|
hintText:
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.strength,
|
|
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// fontSize: 14.0,
|
|
|
|
|
// borderWidth: 0.2,
|
|
|
|
|
|
|
|
|
|
controller:
|
|
|
|
|
strengthController,
|
|
|
|
|
// keyboardType: TextInputType
|
|
|
|
|
// .numberWithOptions(
|
|
|
|
|
// decimal: true,
|
|
|
|
|
// ),
|
|
|
|
|
onChanged: (String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar =
|
|
|
|
|
value.length;
|
|
|
|
|
});
|
|
|
|
|
if (strengthChar >= 5) {
|
|
|
|
|
DrAppToastMsg
|
|
|
|
|
.showErrorToast(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.only5DigitsAllowedForStrength,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// onClick: (_) {
|
|
|
|
|
// if (_selectedMedication !=
|
|
|
|
|
// null &&
|
|
|
|
|
// duration != null &&
|
|
|
|
|
// frequency != null &&
|
|
|
|
|
// strengthController
|
|
|
|
|
// .text !=
|
|
|
|
|
// null) {
|
|
|
|
|
// model.getBoxQuantity(
|
|
|
|
|
// freq: frequency[
|
|
|
|
|
// 'parameterCode'],
|
|
|
|
|
// duration:
|
|
|
|
|
// duration['id'],
|
|
|
|
|
// itemCode:
|
|
|
|
|
// _selectedMedication
|
|
|
|
|
// .itemId,
|
|
|
|
|
// strength: double.parse(
|
|
|
|
|
// strengthController
|
|
|
|
|
// .text));
|
|
|
|
|
// box = model.boxQuintity;
|
|
|
|
|
//
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// validator: (value) {
|
|
|
|
|
// if (value.isEmpty &&
|
|
|
|
|
// strengthController.text.length >
|
|
|
|
|
// 4)
|
|
|
|
|
// return TranslationBase.of(context)
|
|
|
|
|
// .emptyMessage;
|
|
|
|
|
// else
|
|
|
|
|
// return null;
|
|
|
|
|
// },
|
|
|
|
|
),
|
|
|
|
|
child: TextField(
|
|
|
|
|
decoration:
|
|
|
|
|
textFieldSelectorDecoration(
|
|
|
|
|
"",
|
|
|
|
|
'Strength', //strengthController.text,
|
|
|
|
|
false),
|
|
|
|
|
enabled: true,
|
|
|
|
|
controller:
|
|
|
|
|
strengthController,
|
|
|
|
|
onChanged:
|
|
|
|
|
(String value) {
|
|
|
|
|
setState(() {
|
|
|
|
|
strengthChar =
|
|
|
|
|
value.length;
|
|
|
|
|
});
|
|
|
|
|
if (strengthChar >= 5) {
|
|
|
|
|
DrAppToastMsg
|
|
|
|
|
.showErrorToast(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
context)
|
|
|
|
|
.only5DigitsAllowedForStrength,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
keyboardType: TextInputType
|
|
|
|
|
.numberWithOptions(
|
|
|
|
|
decimal: true,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 5.0,
|
|
|
|
|
|