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);
}
});
changeParentState();
// changeParentState();
Navigator.of(context).pop();
} else {
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/shared/TextFields.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'app-textfield-custom.dart';
import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart';
import 'expandable-widget-header-body.dart';
@ -62,9 +64,11 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
child: Expanded(
child: Column(
children: [
Container(
Expanded(
child: Container(
height: MediaQuery.of(context).size.height * 0.70,
child: Center(
child: Container(
@ -238,8 +242,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
),
bodyWidget: Column(
children: [
TextFields(
onTapTextFields: widget.model
AppTextFieldCustom(
onClick: widget.model
.allergySeverityList !=
null
? () {
@ -271,38 +275,19 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
);
}
: null,
hasLabelText:
mySelectedAllergy != null &&
mySelectedAllergy
.selectedAllergySeverity !=
null
? true
: false,
showLabelText: true,
isDropDown: true,
hintText:
TranslationBase
.of(context)
.selectSeverity,
fontSize: 13.5,
readOnly: true,
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
enabled: false,
maxLines: 2,
minLines: 1,
controller: severityController,
validator: (value) {
if (value == null)
return TranslationBase
.of(
context)
.emptyMessage;
else
return null;
}),
minLines: 2,
controller: severityController,),
SizedBox(
height: 5,
),
if(isSubmitted &&
if(isSubmitted && mySelectedAllergy !=null &&
mySelectedAllergy
.selectedAllergySeverity == null)
Row(
@ -319,13 +304,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
Container(
margin: EdgeInsets.only(
left: 0, right: 0, top: 15),
child: TextFields(
hasLabelText:
remarkController.text !=
''
? true
: false,
showLabelText: true,
child: NewTextFields(
hintText: TranslationBase
.of(
context)
@ -334,7 +313,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
// hintColor: Colors.black,
fontWeight: FontWeight.w600,
maxLines: 25,
minLines: 10,
minLines: 3,
initialValue: isSelected
? mySelectedAllergy
.remark : '',
@ -344,7 +323,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (isSelected) {
mySelectedAllergy
.remark = value;
};
}
},
validator: (value) {
@ -365,214 +344,6 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
? mySelectedAllergy.isExpanded
: 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(
height: 10,
),
@ -599,6 +371,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
),
],
),
),
);
}

Loading…
Cancel
Save