fix overflow in allergies

merge-requests/477/head
Elham Rababah 5 years ago
parent 344ca9c55a
commit e668fd3334

@ -246,7 +246,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
}); });
changeParentState(); // changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
helpers.showErrorToast(TranslationBase helpers.showErrorToast(TranslationBase

@ -7,11 +7,13 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/custom_validation_error.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'app-textfield-custom.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart'; import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart'; import 'expandable-widget-header-body.dart';
@ -62,9 +64,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
child: Expanded(
child: Column( child: Column(
children: [ children: [
Container( Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.70, height: MediaQuery.of(context).size.height * 0.70,
child: Center( child: Center(
child: Container( child: Container(
@ -238,8 +242,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
), ),
bodyWidget: Column( bodyWidget: Column(
children: [ children: [
TextFields( AppTextFieldCustom(
onTapTextFields: widget.model onClick: widget.model
.allergySeverityList != .allergySeverityList !=
null null
? () { ? () {
@ -271,38 +275,19 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
); );
} }
: null, : null,
hasLabelText: isDropDown: true,
mySelectedAllergy != null &&
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText: hintText:
TranslationBase TranslationBase
.of(context) .of(context)
.selectSeverity, .selectSeverity,
fontSize: 13.5, enabled: false,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2, maxLines: 2,
minLines: 1, minLines: 2,
controller: severityController, controller: severityController,),
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if(isSubmitted && if(isSubmitted && mySelectedAllergy !=null &&
mySelectedAllergy mySelectedAllergy
.selectedAllergySeverity == null) .selectedAllergySeverity == null)
Row( Row(
@ -319,13 +304,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: 0, right: 0, top: 15), left: 0, right: 0, top: 15),
child: TextFields( child: NewTextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase hintText: TranslationBase
.of( .of(
context) context)
@ -334,7 +313,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
// hintColor: Colors.black, // hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
maxLines: 25, maxLines: 25,
minLines: 10, minLines: 3,
initialValue: isSelected initialValue: isSelected
? mySelectedAllergy ? mySelectedAllergy
.remark : '', .remark : '',
@ -344,7 +323,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (isSelected) { if (isSelected) {
mySelectedAllergy mySelectedAllergy
.remark = value; .remark = value;
}; }
}, },
validator: (value) { validator: (value) {
@ -365,214 +344,6 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
? mySelectedAllergy.isExpanded ? mySelectedAllergy.isExpanded
: false, : false,
); );
Column(
children: [
InkWell(
onTap: () {
setState(() {
if (widget.isServiceSelected(
items[index])) {
widget
.removeAllergy(
items[index]);
} else {
// TODO add Allergy
MySelectedAllergy
mySelectedAllergy =
new MySelectedAllergy(
selectedAllergy:
items[index],
selectedAllergySeverity:
_selectedAllergySeverity,
remark: null,
isChecked: true);
widget.addAllergy(
mySelectedAllergy);
}
});
},
child: Column(
children: [
Row(
children: [
Checkbox(
value: widget
.isServiceSelected(
items[index]),
activeColor:
Colors.red[800],
onChanged: (bool newValue) {
// setState(() {
// if (widget
// .isServiceSelected(items[index])) {
// widget.removeHistory(items[index]);
// } else {
// widget.addHistory(items[index]);
// }
// });
}),
Expanded(
child: Padding(
padding: const EdgeInsets
.symmetric(
horizontal: 10,
vertical: 0),
child: AppText(
projectViewModel.isArabic
? items[index]
.nameAr !=
""
? items[index]
.nameAr
: items[index]
.nameEn
: items[index].nameEn,
color: Color(0xFF575757),
fontSize: 16,
fontWeight:
FontWeight.w600,
),
),
),
],
),
if(widget
.isServiceSelected(
items[index]))
Column(children: [
TextFields(
onTapTextFields: widget.model
.allergySeverityList !=
null
? () {
MasterKeyDailog dialog =
MasterKeyDailog(
list: widget.model
.allergySeverityList,
okText:
TranslationBase.of(
context)
.ok,
okFunction:
(selectedValue) {
setState(() {
mySelectedAllergy
.selectedAllergySeverity =
selectedValue;
});
},
);
showDialog(
barrierDismissible:
false,
context: context,
builder: (BuildContext
context) {
return dialog;
},
);
}
: null,
hasLabelText:
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
SizedBox(
height: 5,
),
if(isSubmitted &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
children: [
CustomValidationError(),
],
mainAxisAlignment: MainAxisAlignment.start,
),
SizedBox(
height: 10,
),
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
hintText: TranslationBase
.of(
context)
.remarks,
fontSize: 13.5,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
// controller: remarkControlle
onChanged: (value) {
if (isSelected) {
mySelectedAllergy
.remark = value;
};
},
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
),
SizedBox(
height: 10,
),
],)
],
),
),
// DividerWithSpacesAround(),
],
);
}, },
), ),
), ),
@ -582,6 +353,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
) )
)), )),
), ),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -599,6 +371,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
), ),
], ],
), ),
),
); );
} }

Loading…
Cancel
Save