scroll added on add assessment

development-3.3_voipCall
Sultan khan 2 years ago
parent fde016c38b
commit bee21f1123

@ -124,8 +124,8 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Column(
child: InkWell( children:[ InkWell(
onTap: model.listOfICD10 != null onTap: model.listOfICD10 != null
? () { ? () {
setState(() { setState(() {
@ -134,87 +134,113 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
}); });
} }
: null, : null,
child: widget.mySelectedAssessment.selectedICD == null child: AppTextFieldCustom(
? CustomAutoCompleteTextField( onChanged: (text){
isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, setState(() {
child: Row( icdNameController.text;
mainAxisAlignment: MainAxisAlignment.spaceBetween, });
mainAxisSize: MainAxisSize.min, },
children: [ height: Utils.getTextFieldHeight(),
Expanded( onClick: model.listOfICD10 != null
flex: 4, ? () {
child: AutoCompleteTextField<MasterKeyModel>( setState(() {
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), widget.mySelectedAssessment.selectedICD = null;
controller: icdNameController, icdNameController.text = null;
itemSubmitted: (item) => setState(() { });
widget.mySelectedAssessment.selectedICD = item; }
// icdNameController.text = '${item.code.trim()}/${item.description}'; : null,
icdNameController.text = '${item.description}'; hintText: TranslationBase.of(context).nameOrICD,
}), maxLines: 1,
key: key, minLines: 1,
suggestions: model.listOfICD10, controller: icdNameController,
suggestionsAmount: 10, enabled: true,
itemBuilder: (context, suggestion) => isTextFieldHasSuffix: true,
new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), suffixIcon: IconButton(
itemSorter: (a, b) => 1, onPressed: () {
itemFilter: (suggestion, input) => print(icdNameController.text);
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || if (icdNameController.text.length <= 3) {
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// suggestion.code.toLowerCase().startsWith(input.toLowerCase()), } else {
suggestion.description.toLowerCase().contains(input.toLowerCase()) || model.listOfICD10.clear();
// suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
suggestion.code.toLowerCase().contains(input.toLowerCase()), }
), },
), icon: Icon(
Expanded( Icons.search,
child: IconButton( color: Colors.grey.shade600,
onPressed: () {
print(icdNameController.text);
if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else {
model.listOfICD10.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
},
icon: Icon(Icons.search),
),
),
],
),
)
: AppTextFieldCustom(
height: Utils.getTextFieldHeight(),
onClick: model.listOfICD10 != null
? () {
setState(() {
widget.mySelectedAssessment.selectedICD = null;
icdNameController.text = null;
});
}
: null,
hintText: TranslationBase.of(context).nameOrICD,
maxLines: 1,
minLines: 1,
controller: icdNameController,
enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
onPressed: () {
print(icdNameController.text);
if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else {
model.listOfICD10.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
}
},
icon: Icon(
Icons.search,
color: Colors.grey.shade600,
)),
)), )),
), )),
model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child:ListView.builder(
shrinkWrap: true,
itemCount: model.listOfICD10.length,
itemBuilder: (context, index) {
return InkWell(child:ListTile(
title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)),
onTap: (){
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index];
icdNameController.text = model.listOfICD10[index].description;
model.listOfICD10.clear();
setState(() {
});
}
);
},
)) :SizedBox()
// CustomAutoCompleteTextField(
// isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null,
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
// children: [
// AutoCompleteTextField<MasterKeyModel>(
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null),
// controller: icdNameController,
// itemSubmitted: (item) => setState(() {
// widget.mySelectedAssessment.selectedICD = item;
// // icdNameController.text = '${item.code.trim()}/${item.description}';
// icdNameController.text = '${item.description}';
// }),
// key: key,
// suggestions: model.listOfICD10,
// suggestionsAmount: model.listOfICD10.length,
// itemBuilder: (context, suggestion) =>
// new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)),
// itemSorter: (a, b) => 1,
// itemFilter: (suggestion, input) =>
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// // suggestion.code.toLowerCase().startsWith(input.toLowerCase()),
// suggestion.description.toLowerCase().contains(input.toLowerCase()) ||
// // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||
// suggestion.code.toLowerCase().contains(input.toLowerCase()),
//
// ),
// Expanded(
// child: IconButton(
// onPressed: () {
// print(icdNameController.text);
// if (icdNameController.text.length <= 3) {
// DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
// } else {
// model.listOfICD10.clear();
// model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
// }
// },
// icon: Icon(Icons.search),
// ),
// ),
// ],
// ),
// )
]),
if (widget.mySelectedAssessment.selectedICD != null) if (widget.mySelectedAssessment.selectedICD != null)
Column( Column(
children: [ children: [

Loading…
Cancel
Save