jira bug fixing

merge-requests/312/head
hussam al-habibeh 5 years ago
parent d20e83faa5
commit 39d2fe879c

@ -214,16 +214,16 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
0] 0]
.entityList[ .entityList[
index] index]
.startDate) .createdOn)
.day .day
.toString(), .toString(),
color: Colors color: Colors
.green, .green,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].startDate != Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
null null
? (DateTime.parse(model.prescriptionList[0].entityList[index].startDate) ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
.month) .month)
: DateTime.now() : DateTime.now()
.month) .month)
@ -261,9 +261,13 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
child: child:
AppText( AppText(
model model
.prescriptionList[0] .prescriptionList[
.entityList[index] 0]
.startDate, .entityList[
index]
.startDate
.replaceAll("-",
"/"),
fontSize: fontSize:
12.0, 12.0,
), ),

@ -79,7 +79,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
remarksController.text = widget.remarks;
indicationList = List(); indicationList = List();
dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"};
@ -146,8 +146,9 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
minChildSize: 0.6, minChildSize: 0.6,
builder: builder:
(BuildContext context, ScrollController scrollController) { (BuildContext context, ScrollController scrollController) {
return Container( return SingleChildScrollView(
height: MediaQuery.of(context).size.height * 2.5, child: Container(
height: MediaQuery.of(context).size.height * 2.0,
child: Form( child: Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -237,7 +238,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
// height: 12, // height: 12,
// ), // ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.060, 0.060,
width: double.infinity, width: double.infinity,
child: Row( child: Row(
@ -261,7 +263,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
hintText: widget.doseStreangth, hintText: widget.doseStreangth,
fontSize: 15.0, fontSize: 15.0,
controller: strengthController, controller: strengthController,
keyboardType: TextInputType.number, keyboardType:
TextInputType.number,
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
strengthChar = value.length; strengthChar = value.length;
@ -322,7 +325,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
barrierDismissible: barrierDismissible:
false, false,
context: context, context: context,
builder: (BuildContext builder:
(BuildContext
context) { context) {
return dialog; return dialog;
}, },
@ -348,7 +352,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12, height: 12,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationRouteList != null onTap: model.medicationRouteList != null
@ -356,11 +361,12 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
Helpers.hideKeyboard(context); Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog dialog =
ListSelectDialog( ListSelectDialog(
list: model.medicationRouteList, list:
model.medicationRouteList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -382,7 +388,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
textFieldSelectorDecoration(
'Route', 'Route',
route != null route != null
? route['nameEn'] ? route['nameEn']
@ -396,7 +403,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDoseTimeList != onTap: model.medicationDoseTimeList !=
@ -409,8 +417,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
.medicationDoseTimeList, .medicationDoseTimeList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -429,7 +437,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.doseTime, .doseTime,
doseTime != null doseTime != null
@ -444,7 +453,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationFrequencyList != onTap: model.medicationFrequencyList !=
@ -457,8 +467,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
.medicationFrequencyList, .medicationFrequencyList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -478,11 +488,13 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.frequency, .frequency,
frequencyUpdate != null frequencyUpdate != null
? frequencyUpdate['nameEn'] ? frequencyUpdate[
'nameEn']
: null, : null,
true), true),
enabled: false, enabled: false,
@ -493,7 +505,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 12.0, height: 12.0,
), ),
Container( Container(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.070, 0.070,
child: InkWell( child: InkWell(
onTap: model.medicationDurationList != onTap: model.medicationDurationList !=
@ -506,8 +519,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
.medicationDurationList, .medicationDurationList,
attributeName: 'nameEn', attributeName: 'nameEn',
attributeValueId: 'id', attributeValueId: 'id',
okText: okText: TranslationBase.of(
TranslationBase.of(context) context)
.ok, .ok,
okFunction: (selectedValue) { okFunction: (selectedValue) {
setState(() { setState(() {
@ -527,11 +540,13 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
} }
: null, : null,
child: TextField( child: TextField(
decoration: textFieldSelectorDecoration( decoration:
textFieldSelectorDecoration(
TranslationBase.of(context) TranslationBase.of(context)
.duration, .duration,
updatedDuration != null updatedDuration != null
? updatedDuration['nameEn'] ? updatedDuration[
'nameEn']
.toString() .toString()
: null, : null,
true), true),
@ -618,8 +633,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
onTap: () => onTap: () =>
selectDate(context, widget.model), selectDate(context, widget.model),
child: TextField( child: TextField(
decoration: decoration: Helpers
Helpers.textFieldSelectorDecoration( .textFieldSelectorDecoration(
widget.startDate, widget.startDate,
selectedDate != null selectedDate != null
? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
@ -644,7 +659,6 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
width: 1.0, width: 1.0,
color: HexColor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
child: TextFields( child: TextFields(
hintText: widget.remarks,
controller: remarksController, controller: remarksController,
maxLines: 7, maxLines: 7,
minLines: 4, minLines: 4,
@ -654,7 +668,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
height: 10.0, height: 10.0,
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * height:
MediaQuery.of(context).size.height *
0.08, 0.08,
), ),
Container( Container(
@ -674,15 +689,14 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
.text.isNotEmpty .text.isNotEmpty
? strengthController ? strengthController
.text .text
: widget.doseStreangth, : widget
newUnit: .doseStreangth,
units != newUnit: units != null
null
? units['id'].toString() ? units['id'].toString()
: widget.doseUnit, : widget.doseUnit,
doseUnit: widget.doseUnit, doseUnit: widget.doseUnit,
doseStreangth: widget doseStreangth:
.doseStreangth, widget.doseStreangth,
duration: widget.duration, duration: widget.duration,
startDate: widget.startDate, startDate: widget.startDate,
doseId: widget.dose, doseId: widget.dose,
@ -690,27 +704,25 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
routeId: widget.route, routeId: widget.route,
patient: widget.patient, patient: widget.patient,
model: widget.model, model: widget.model,
newDuration: newDuration: updatedDuration !=
updatedDuration !=
null null
? updatedDuration[ ? updatedDuration['id']
'id']
.toString() .toString()
: widget.duration, : widget.duration,
drugId: widget.drugId, drugId: widget.drugId,
remarks: remarksController.text, remarks:
route: route != remarksController.text,
null route: route != null
? route['id'].toString() ? route['id'].toString()
: widget.route, : widget.route,
frequency: frequency: frequencyUpdate !=
frequencyUpdate !=
null null
? frequencyUpdate['id'] ? frequencyUpdate['id']
.toString() .toString()
: widget.frequency, : widget.frequency,
dose: doseTime != null dose: doseTime != null
? doseTime['id'].toString() ? doseTime['id']
.toString()
: widget.dose, : widget.dose,
enteredRemarks: enteredRemarks:
widget.enteredRemarks); widget.enteredRemarks);
@ -725,7 +737,8 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
], ],
), ),
), ),
)); )),
);
}), }),
), ),
), ),

Loading…
Cancel
Save