Merge branch 'episode_fixes' into 'development'
Episode fixes See merge request Cloud_Solution/doctor_app_flutter!773merge-requests/774/merge
commit
4553570547
@ -0,0 +1,197 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.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';
|
||||
|
||||
class AddAllergiesItem extends StatefulWidget {
|
||||
final SOAPViewModel model;
|
||||
final Function(MasterKeyModel) removeAllergy;
|
||||
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
|
||||
final bool Function(MasterKeyModel) isServiceSelected;
|
||||
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
|
||||
|
||||
final MasterKeyModel item;
|
||||
|
||||
const AddAllergiesItem(
|
||||
{Key key,
|
||||
this.model,
|
||||
this.removeAllergy,
|
||||
this.addAllergy,
|
||||
this.isServiceSelected,
|
||||
this.getServiceSelectedAllergy,
|
||||
this.item})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_AddAllergiesItemState createState() => _AddAllergiesItemState();
|
||||
}
|
||||
|
||||
class _AddAllergiesItemState extends State<AddAllergiesItem> {
|
||||
MasterKeyModel _selectedAllergySeverity;
|
||||
bool isSubmitted = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
|
||||
bool isSelected = widget.isServiceSelected(widget.item);
|
||||
MySelectedAllergy mySelectedAllergy;
|
||||
if (isSelected) {
|
||||
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
|
||||
}
|
||||
TextEditingController remarkController = TextEditingController(
|
||||
text: isSelected ? mySelectedAllergy.remark : null);
|
||||
TextEditingController severityController = TextEditingController(
|
||||
text: isSelected
|
||||
? mySelectedAllergy.selectedAllergySeverity != null
|
||||
? projectViewModel.isArabic
|
||||
? mySelectedAllergy.selectedAllergySeverity.nameAr
|
||||
: mySelectedAllergy.selectedAllergySeverity.nameEn
|
||||
: null
|
||||
: null);
|
||||
return HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: widget.isServiceSelected(widget.item),
|
||||
activeColor: Colors.red[800],
|
||||
onChanged: (bool newValue) {
|
||||
onTapItem();
|
||||
}),
|
||||
InkWell(
|
||||
onTap:onTapItem,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 10, vertical: 0),
|
||||
child: Container(
|
||||
child: AppText(
|
||||
projectViewModel.isArabic
|
||||
? widget.item.nameAr != ""
|
||||
? widget.item.nameAr
|
||||
: widget.item.nameEn
|
||||
: widget.item.nameEn,
|
||||
color: Color(0xFF575757),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
width: MediaQuery.of(context).size.width * 0.55,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (mySelectedAllergy != null) {
|
||||
setState(() {
|
||||
mySelectedAllergy.isExpanded =
|
||||
mySelectedAllergy.isExpanded ? false : true;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Icon((mySelectedAllergy != null
|
||||
? mySelectedAllergy.isExpanded
|
||||
: false)
|
||||
? EvaIcons.arrowIosUpwardOutline
|
||||
: EvaIcons.arrowIosDownwardOutline))
|
||||
],
|
||||
),
|
||||
bodyWidget: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextFieldCustom(
|
||||
onClick: widget.model.allergySeverityList != null
|
||||
? () {
|
||||
MasterKeyDailog dialog = MasterKeyDailog(
|
||||
list: widget.model.allergySeverityList,
|
||||
selectedValue:
|
||||
mySelectedAllergy.selectedAllergySeverity,
|
||||
okText: TranslationBase.of(context).ok,
|
||||
okFunction: (selectedValue) {
|
||||
setState(() {
|
||||
mySelectedAllergy.selectedAllergySeverity =
|
||||
selectedValue;
|
||||
});
|
||||
},
|
||||
);
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return dialog;
|
||||
},
|
||||
);
|
||||
}
|
||||
: null,
|
||||
isTextFieldHasSuffix: true,
|
||||
hintText: TranslationBase.of(context).selectSeverity,
|
||||
enabled: false,
|
||||
maxLines: 2,
|
||||
minLines: 2,
|
||||
validationError: mySelectedAllergy != null &&
|
||||
mySelectedAllergy.selectedAllergySeverity == null &&
|
||||
mySelectedAllergy.hasValidationError
|
||||
? TranslationBase.of(context).emptyMessage
|
||||
: null,
|
||||
controller: severityController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
AppTextFieldCustom(
|
||||
hintText: TranslationBase.of(context).remarks,
|
||||
controller: remarkController,
|
||||
maxLines: 25,
|
||||
minLines: 3,
|
||||
hasBorder: true,
|
||||
onChanged: (value){
|
||||
mySelectedAllergy.remark = value;
|
||||
},
|
||||
inputType: TextInputType.multiline,
|
||||
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
isExpand:
|
||||
mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false,
|
||||
);
|
||||
}
|
||||
|
||||
onTapItem(){
|
||||
setState(() {
|
||||
if (widget.isServiceSelected(widget.item)) {
|
||||
widget.removeAllergy(widget.item);
|
||||
} else {
|
||||
MySelectedAllergy mySelectedAllergy =
|
||||
new MySelectedAllergy(
|
||||
selectedAllergy: widget.item,
|
||||
selectedAllergySeverity: _selectedAllergySeverity,
|
||||
remark: null,
|
||||
isChecked: true,
|
||||
isExpanded: true);
|
||||
widget.addAllergy(mySelectedAllergy);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'allergies_item.dart';
|
||||
|
||||
|
||||
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
|
||||
final SOAPViewModel model;
|
||||
final Function() addSelectedAllergy;
|
||||
final Function(MasterKeyModel) removeAllergy;
|
||||
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
|
||||
final bool Function(MasterKeyModel) isServiceSelected;
|
||||
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
|
||||
|
||||
final List<MasterKeyModel> masterList;
|
||||
final String buttonName;
|
||||
final String hintSearchText;
|
||||
|
||||
MasterKeyCheckboxSearchAllergiesWidget(
|
||||
{Key key,
|
||||
this.model,
|
||||
this.addSelectedAllergy,
|
||||
this.removeAllergy,
|
||||
this.masterList,
|
||||
this.addAllergy,
|
||||
this.isServiceSelected,
|
||||
this.buttonName,
|
||||
this.hintSearchText,
|
||||
this.getServiceSelectedAllergy})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
|
||||
_MasterKeyCheckboxSearchAllergiesWidgetState();
|
||||
}
|
||||
|
||||
class _MasterKeyCheckboxSearchAllergiesWidgetState
|
||||
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
|
||||
List<MasterKeyModel> items = List();
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
items.addAll(widget.masterList);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.70,
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextFieldCustom(
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height * 0.070,
|
||||
hintText:
|
||||
TranslationBase.of(context).selectAllergy,
|
||||
isTextFieldHasSuffix: true,
|
||||
hasBorder: false,
|
||||
// controller: filteredSearchController,
|
||||
onChanged: (value) {
|
||||
filterSearchResults(value);
|
||||
},
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
DividerWithSpacesAround(),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.60,
|
||||
child: ListView.builder(
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) {
|
||||
|
||||
return AddAllergiesItem(
|
||||
item:items[index],
|
||||
model: widget.model,
|
||||
removeAllergy: widget.removeAllergy,
|
||||
addAllergy:widget.addAllergy,
|
||||
isServiceSelected: widget.isServiceSelected,
|
||||
getServiceSelectedAllergy: widget.getServiceSelectedAllergy,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void filterSearchResults(String query) {
|
||||
List<MasterKeyModel> dummySearchList = List();
|
||||
dummySearchList.addAll(widget.masterList);
|
||||
if (query.isNotEmpty) {
|
||||
List<MasterKeyModel> dummyListData = List();
|
||||
dummySearchList.forEach((items) {
|
||||
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
|
||||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
|
||||
dummyListData.add(items);
|
||||
}
|
||||
});
|
||||
setState(() {
|
||||
items.clear();
|
||||
items.addAll(dummyListData);
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
setState(() {
|
||||
items.clear();
|
||||
items.addAll(widget.masterList);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -1,421 +0,0 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
|
||||
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/text_fields/new_text_Field.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.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_texts_widget.dart';
|
||||
import 'dialogs/master_key_dailog.dart';
|
||||
import 'divider_with_spaces_around.dart';
|
||||
import 'expandable-widget-header-body.dart';
|
||||
import 'text_fields/app-textfield-custom.dart';
|
||||
|
||||
class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
|
||||
final SOAPViewModel model;
|
||||
final Function() addSelectedAllergy;
|
||||
final Function(MasterKeyModel) removeAllergy;
|
||||
final Function(MySelectedAllergy mySelectedAllergy) addAllergy;
|
||||
final bool Function(MasterKeyModel) isServiceSelected;
|
||||
final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy;
|
||||
|
||||
final List<MasterKeyModel> masterList;
|
||||
final String buttonName;
|
||||
final String hintSearchText;
|
||||
|
||||
MasterKeyCheckboxSearchAllergiesWidget(
|
||||
{Key key,
|
||||
this.model,
|
||||
this.addSelectedAllergy,
|
||||
this.removeAllergy,
|
||||
this.masterList,
|
||||
this.addAllergy,
|
||||
this.isServiceSelected,
|
||||
this.buttonName,
|
||||
this.hintSearchText,
|
||||
this.getServiceSelectedAllergy})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_MasterKeyCheckboxSearchAllergiesWidgetState createState() =>
|
||||
_MasterKeyCheckboxSearchAllergiesWidgetState();
|
||||
}
|
||||
|
||||
class _MasterKeyCheckboxSearchAllergiesWidgetState
|
||||
extends State<MasterKeyCheckboxSearchAllergiesWidget> {
|
||||
List<MasterKeyModel> items = List();
|
||||
MasterKeyModel _selectedAllergySeverity;
|
||||
bool isSubmitted = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
items.addAll(widget.masterList);
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.70,
|
||||
child: Center(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: Colors.white),
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextFieldCustom(
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height * 0.070,
|
||||
hintText:
|
||||
TranslationBase.of(context).selectAllergy,
|
||||
isTextFieldHasSuffix: true,
|
||||
hasBorder: false,
|
||||
// controller: filteredSearchController,
|
||||
onChanged: (value) {
|
||||
filterSearchResults(value);
|
||||
},
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
Icons.search,
|
||||
color: Colors.black,
|
||||
)),
|
||||
),
|
||||
DividerWithSpacesAround(),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.60,
|
||||
child: ListView.builder(
|
||||
itemCount: items.length,
|
||||
itemBuilder: (context, index) {
|
||||
bool isSelected = widget
|
||||
.isServiceSelected(items[index]);
|
||||
MySelectedAllergy mySelectedAllergy;
|
||||
if (isSelected) {
|
||||
mySelectedAllergy =
|
||||
widget.getServiceSelectedAllergy(
|
||||
items[index]);
|
||||
}
|
||||
TextEditingController remarkController =
|
||||
TextEditingController(
|
||||
text: isSelected
|
||||
? mySelectedAllergy.remark
|
||||
: null);
|
||||
TextEditingController severityController =
|
||||
TextEditingController(
|
||||
text: isSelected
|
||||
? mySelectedAllergy
|
||||
.selectedAllergySeverity !=
|
||||
null
|
||||
? projectViewModel
|
||||
.isArabic
|
||||
? mySelectedAllergy
|
||||
.selectedAllergySeverity
|
||||
.nameAr
|
||||
: mySelectedAllergy
|
||||
.selectedAllergySeverity
|
||||
.nameEn
|
||||
: null
|
||||
: null);
|
||||
return HeaderBodyExpandableNotifier(
|
||||
headerWidget: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: widget
|
||||
.isServiceSelected(
|
||||
items[index]),
|
||||
activeColor:
|
||||
Colors.red[800],
|
||||
onChanged: (bool newValue) {
|
||||
setState(() {
|
||||
if (widget
|
||||
.isServiceSelected(
|
||||
items[index])) {
|
||||
widget.removeAllergy(
|
||||
items[index]);
|
||||
} else {
|
||||
MySelectedAllergy
|
||||
mySelectedAllergy =
|
||||
new MySelectedAllergy(
|
||||
selectedAllergy:
|
||||
items[
|
||||
index],
|
||||
selectedAllergySeverity:
|
||||
_selectedAllergySeverity,
|
||||
remark: null,
|
||||
isChecked:
|
||||
true,
|
||||
isExpanded:
|
||||
true);
|
||||
widget.addAllergy(
|
||||
mySelectedAllergy);
|
||||
}
|
||||
});
|
||||
}),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if (widget
|
||||
.isServiceSelected(
|
||||
items[index])) {
|
||||
widget.removeAllergy(
|
||||
items[index]);
|
||||
} else {
|
||||
|
||||
MySelectedAllergy mySelectedAllergy =
|
||||
new MySelectedAllergy(
|
||||
selectedAllergy:
|
||||
items[
|
||||
index],
|
||||
selectedAllergySeverity:
|
||||
_selectedAllergySeverity,
|
||||
remark: null,
|
||||
isChecked: true,
|
||||
isExpanded:
|
||||
true);
|
||||
widget.addAllergy(
|
||||
mySelectedAllergy);
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 0),
|
||||
child: Container(
|
||||
child: AppText(
|
||||
projectViewModel
|
||||
.isArabic
|
||||
? items[index]
|
||||
.nameAr !=
|
||||
""
|
||||
? items[index]
|
||||
.nameAr
|
||||
: items[index]
|
||||
.nameEn
|
||||
: items[index]
|
||||
.nameEn,
|
||||
color:
|
||||
Color(0xFF575757),
|
||||
fontSize: 16,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
width:
|
||||
MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.55,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (mySelectedAllergy !=
|
||||
null) {
|
||||
setState(() {
|
||||
mySelectedAllergy
|
||||
.isExpanded =
|
||||
mySelectedAllergy
|
||||
.isExpanded
|
||||
? false
|
||||
: true;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Icon((mySelectedAllergy !=
|
||||
null
|
||||
? mySelectedAllergy
|
||||
.isExpanded
|
||||
: false)
|
||||
? EvaIcons
|
||||
.arrowIosUpwardOutline
|
||||
: EvaIcons
|
||||
.arrowIosDownwardOutline))
|
||||
],
|
||||
),
|
||||
bodyWidget: Center(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.9,
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextFieldCustom(
|
||||
onClick: 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,
|
||||
isTextFieldHasSuffix: true,
|
||||
hintText:
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.selectSeverity,
|
||||
enabled: false,
|
||||
maxLines: 2,
|
||||
minLines: 2,
|
||||
controller:
|
||||
severityController,
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
),
|
||||
if (isSubmitted &&
|
||||
mySelectedAllergy !=
|
||||
null &&
|
||||
mySelectedAllergy
|
||||
.selectedAllergySeverity ==
|
||||
null)
|
||||
Row(
|
||||
children: [
|
||||
CustomValidationError(),
|
||||
],
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.start,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 15),
|
||||
child: NewTextFields(
|
||||
hintText:
|
||||
TranslationBase.of(
|
||||
context)
|
||||
.remarks,
|
||||
fontSize: 13.5,
|
||||
// hintColor: Colors.black,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
maxLines: 25,
|
||||
minLines: 3,
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
isExpand: mySelectedAllergy != null
|
||||
? mySelectedAllergy.isExpanded
|
||||
: false,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
))),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void filterSearchResults(String query) {
|
||||
List<MasterKeyModel> dummySearchList = List();
|
||||
dummySearchList.addAll(widget.masterList);
|
||||
if (query.isNotEmpty) {
|
||||
List<MasterKeyModel> dummyListData = List();
|
||||
dummySearchList.forEach((items) {
|
||||
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) ||
|
||||
items.nameEn.toLowerCase().contains(query.toLowerCase())) {
|
||||
dummyListData.add(items);
|
||||
}
|
||||
});
|
||||
setState(() {
|
||||
items.clear();
|
||||
items.addAll(dummyListData);
|
||||
});
|
||||
return;
|
||||
} else {
|
||||
setState(() {
|
||||
items.clear();
|
||||
items.addAll(widget.masterList);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue