|
|
|
|
@ -446,85 +446,40 @@ 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:
|
|
|
|
|
textFieldSelectorDecorationStreangrh(
|
|
|
|
|
strengthController
|
|
|
|
|
.text,
|
|
|
|
|
'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,
|
|
|
|
|
@ -1394,6 +1349,48 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InputDecoration textFieldSelectorDecorationStreangrh(
|
|
|
|
|
String hintText, String selectedText, bool isDropDown,
|
|
|
|
|
{Icon suffixIcon}) {
|
|
|
|
|
return InputDecoration(
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
disabledBorder: OutlineInputBorder(
|
|
|
|
|
borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0),
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
suffixIcon: isDropDown
|
|
|
|
|
? suffixIcon != null
|
|
|
|
|
? suffixIcon
|
|
|
|
|
: Icon(
|
|
|
|
|
Icons.keyboard_arrow_down_sharp,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
hintText: selectedText == null || selectedText == "" ? hintText : null,
|
|
|
|
|
labelText:
|
|
|
|
|
selectedText != null && selectedText != "" ? '\n$selectedText' : null,
|
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
color: Color(0xff2E303A),
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openDrugToDrug(model) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
|