bug fixing

ipd-changes-for-vida-plus
hussam al-habibeh 6 years ago
parent bd69219a86
commit 8bf578082b

@ -210,20 +210,21 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
NetworkBaseView(
baseViewModel: model,
child: GestureDetector(
onTap: (){
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: DraggableScrollableSheet(
initialChildSize: 0.90,
maxChildSize: 0.90,
minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) {
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: 1010,
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -267,8 +268,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
true,
),
itemSubmitted: (item) => setState(
() =>
_selectedMedication = item),
() => _selectedMedication =
item),
key: key,
suggestions:
model.allMedicationList,
@ -278,19 +279,18 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Texts(suggestion
.description +
'/' +
suggestion.genericName),
suggestion
.genericName),
padding:
EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) =>
suggestion.genericName
.toLowerCase()
.startsWith(
suggestion.genericName.toLowerCase().startsWith(
input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input.toLowerCase()) ||
.startsWith(input
.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
@ -338,16 +338,19 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row(
children: [
Container(
width:
MediaQuery.of(context).size.width *
width: MediaQuery.of(context)
.size
.width *
0.550,
child: TextFields(
inputFormatters: [
LengthLimitingTextInputFormatter(4),
LengthLimitingTextInputFormatter(
4),
WhitelistingTextInputFormatter
.digitsOnly
],
hintText: TranslationBase.of(context)
hintText:
TranslationBase.of(context)
.strength,
controller: strengthController,
keyboardType: TextInputType.number,
@ -375,35 +378,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 10.0,
),
Container(
width:
MediaQuery.of(context).size.width *
width: MediaQuery.of(context)
.size
.width *
0.350,
child: InkWell(
onTap: model.medicationStrengthList !=
onTap:
model.medicationStrengthList !=
null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
Helpers.hideKeyboard(
context);
ListSelectDialog
dialog =
ListSelectDialog(
list: model
.medicationStrengthList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText: TranslationBase.of(
attributeName:
'nameEn',
attributeValueId:
'id',
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
units = selectedValue;
units =
selectedValue;
});
},
);
showDialog(
barrierDismissible: false,
barrierDismissible:
false,
context: context,
builder:
(BuildContext context) {
builder: (BuildContext
context) {
return dialog;
},
);
@ -452,7 +464,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
builder:
(BuildContext context) {
return dialog;
},
);
@ -473,13 +486,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.medicationFrequencyList != null
onTap: model.medicationFrequencyList !=
null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationFrequencyList,
list: model
.medicationFrequencyList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
@ -494,7 +508,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
builder:
(BuildContext context) {
return dialog;
},
);
@ -502,7 +517,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).frequency,
TranslationBase.of(context)
.frequency,
frequency != null
? frequency['nameEn']
: null,
@ -515,13 +531,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.medicationDoseTimeList != null
onTap: model.medicationDoseTimeList !=
null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationDoseTimeList,
list: model
.medicationDoseTimeList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
@ -536,7 +553,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
builder:
(BuildContext context) {
return dialog;
},
);
@ -544,7 +562,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).doseTime,
TranslationBase.of(context)
.doseTime,
doseTime != null
? doseTime['nameEn']
: null,
@ -567,12 +586,13 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
list: indicationList,
attributeName: 'name',
attributeValueId: 'id',
okText:
TranslationBase.of(context)
okText: TranslationBase.of(
context)
.ok,
okFunction: (selectedValue) {
setState(() {
indication = selectedValue;
indication =
selectedValue;
});
},
);
@ -587,7 +607,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
decoration:
textFieldSelectorDecoration(
model.patientAssessmentList[0]
.icdCode10ID
.toString(),
@ -660,7 +681,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextField(
decoration:
Helpers.textFieldSelectorDecoration(
TranslationBase.of(context).date,
TranslationBase.of(context)
.date,
selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
@ -677,13 +699,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
Container(
height: screenSize.height * 0.070,
child: InkWell(
onTap: model.medicationDurationList != null
onTap: model.medicationDurationList !=
null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog =
ListSelectDialog(
list:
model.medicationDurationList,
list: model
.medicationDurationList,
attributeName: 'nameEn',
attributeValueId: 'id',
okText:
@ -698,7 +721,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
builder:
(BuildContext context) {
return dialog;
},
);
@ -706,7 +730,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
: null,
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).duration,
TranslationBase.of(context)
.duration,
duration != null
? duration['nameEn']
: null,
@ -726,8 +751,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: TextFields(
maxLines: 6,
minLines: 4,
hintText:
TranslationBase.of(context).instruction,
hintText: TranslationBase.of(context)
.instruction,
controller: instructionController,
//keyboardType: TextInputType.number,
validator: (value) {
@ -771,7 +796,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
return;
}
if (formKey.currentState.validate()) {
if (formKey.currentState
.validate()) {
Navigator.pop(context);
{
// var x = model
@ -808,8 +834,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
model: widget.model,
duration:
duration['id'].toString(),
frequency:
frequency['id'].toString(),
frequency: frequency['id']
.toString(),
route: route['id'].toString(),
drugId: _selectedMedication
.itemId
@ -819,7 +845,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
indication:
indicationController.text,
instruction:
instructionController.text,
instructionController
.text,
doseTime: selectedDate,
);
}
@ -848,6 +875,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
);
}),
),
),
);
}

Loading…
Cancel
Save