Closed DipakSkywave closed 2 years ago
How to make a scroll filtered listview? & how to resolve to get Instance of BookList issue? @felixlucien @spidgorny @khamasaki @Ainiuso @altherat @msalinas1088
this is my code:
return AutoCompleteTextField( controller: valueController ..selection = TextSelection.collapsed(offset: valueController.text.length), decoration: InputDecoration( hintStyle: AppUtils.showTextWithStyle( 2.0, Colors.black38, FontWeight.normal), border: InputBorder.none, focusedBorder: InputBorder.none, fillColor: Colors.black, isDense: true, helperMaxLines: 1, errorMaxLines: 1, hintMaxLines: 1, contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), filled: false, ), itemBuilder: (context, item) { return Padding( padding: EdgeInsets.only( top: 5.0, left: 10.0, right: 10.0, bottom: 5.0, ), child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( item.name, textAlign: TextAlign.start, overflow: TextOverflow.clip, maxLines: 1, ) ], ), ); }, itemFilter: (item, query) { return item.name.toLowerCase().startsWith(query.toLowerCase()); }, itemSorter: (a, b) { return a.id.compareTo(b.id); }, itemSubmitted: (item) {
}, keyboardType: TextInputType.text, onFocusChanged: (hasFocus) { complete(hasFocus, valueController.text.toString() + " "); }, key: key, suggestionsAmount: 15, suggestions: bookList, clearOnSubmit: false, focusNode: focusNode, textInputAction: TextInputAction.search, );
How to make a scroll filtered listview? & how to resolve to get Instance of BookList issue? @felixlucien @spidgorny @khamasaki @Ainiuso @altherat @msalinas1088
this is my code:
return AutoCompleteTextField(
controller: valueController
..selection =
TextSelection.collapsed(offset: valueController.text.length),
decoration: InputDecoration(
hintStyle: AppUtils.showTextWithStyle(
2.0, Colors.black38, FontWeight.normal),
border: InputBorder.none,
focusedBorder: InputBorder.none,
fillColor: Colors.black,
isDense: true,
helperMaxLines: 1,
errorMaxLines: 1,
hintMaxLines: 1,
contentPadding:
EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
filled: false,
),
itemBuilder: (context, item) {
return Padding(
padding: EdgeInsets.only(
top: 5.0,
left: 10.0,
right: 10.0,
bottom: 5.0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.name,
textAlign: TextAlign.start,
overflow: TextOverflow.clip,
maxLines: 1,
)
],
),
);
},
itemFilter: (item, query) {
return item.name.toLowerCase().startsWith(query.toLowerCase()); },
itemSorter: (a, b) {
return a.id.compareTo(b.id);
},
itemSubmitted: (item) {