SearchableList<T> constructor
SearchableList<T> ({
- Key? key,
- required List<
T> initialList, - required Widget itemBuilder(
- T item
- List<
T> filter(- String query
- Widget? loadingWidget,
- Widget? errorWidget,
- TextEditingController? searchTextController,
- TextInputAction keyboardAction = TextInputAction.done,
- InputDecoration? inputDecoration,
- TextStyle? textStyle,
- dynamic onSubmitSearch()?,
- SearchMode searchMode = SearchMode.onEdit,
- Widget? emptyWidget,
- TextInputType textInputType = TextInputType.text,
- bool obscureText = false,
- FocusNode? focusNode,
- bool searchFieldEnabled = true,
- double? searchFieldWidth,
- double? searchFieldHeight,
- bool displayClearIcon = true,
- Future<
void> onRefresh()?, - Axis scrollDirection = Axis.vertical,
- SearchTextPosition searchTextPosition = SearchTextPosition.top,
- Future onPaginate()?,
- @Deprecated('Deprecated will be removed in the next release, use searchFieldPadding instead') double spaceBetweenSearchAndList = 20,
- EdgeInsetsGeometry? searchFieldPadding,
- Color? cursorColor,
- int? maxLines,
- int? maxLength,
- TextAlign textAlign = TextAlign.start,
- List<
String> autoCompleteHints = const [], - Widget? secondaryWidget,
- ScrollPhysics? physics,
- bool shrinkWrap = false,
- double? itemExtent,
- EdgeInsetsGeometry? listViewPadding,
- bool reverse = false,
- int sortPredicate(
- T a,
- T b
- Widget? sortWidget,
- Widget seperatorBuilder(
- BuildContext context,
- int index
- ScrollController? scrollController,
- bool closeKeyboardWhenScrolling = false,
- bool displaySearchIcon = true,
- Color defaultSuffixIconColor = Colors.grey,
- double defaultSuffixIconSize = 24,
- bool lazyLoadingEnabled = true,
- void onChanged(
- bool? value
- required List<
T> selectedList,
Implementation
SearchableList({
Key? key,
required this.initialList,
required this.itemBuilder,
// this.isSelectALL,
this.filter,
this.loadingWidget,
this.errorWidget,
this.searchTextController,
this.keyboardAction = TextInputAction.done,
this.inputDecoration,
this.textStyle,
this.onSubmitSearch,
this.searchMode = SearchMode.onEdit,
this.emptyWidget,
this.textInputType = TextInputType.text,
this.obscureText = false,
this.focusNode,
this.searchFieldEnabled = true,
this.searchFieldWidth,
this.searchFieldHeight,
this.displayClearIcon = true,
this.onRefresh,
this.scrollDirection = Axis.vertical,
this.searchTextPosition = SearchTextPosition.top,
this.onPaginate,
@Deprecated(
'Deprecated will be removed in the next release, use searchFieldPadding instead',
)
this.spaceBetweenSearchAndList = 20,
this.searchFieldPadding,
this.cursorColor,
this.maxLines,
this.maxLength,
this.textAlign = TextAlign.start,
this.autoCompleteHints = const [],
this.secondaryWidget,
this.physics,
this.shrinkWrap = false,
this.itemExtent,
this.listViewPadding,
this.reverse = false,
this.sortPredicate,
this.sortWidget,
this.seperatorBuilder,
this.scrollController,
this.closeKeyboardWhenScrolling = false,
this.displaySearchIcon = true,
this.defaultSuffixIconColor = Colors.grey,
this.defaultSuffixIconSize = 24,
this.lazyLoadingEnabled = true,
this.onChanged,
required this.selectedList,
}) : super(key: key) {
searchTextController ??= TextEditingController();
expansionListBuilder = null;
asyncListCallback = null;
asyncListFilter = null;
if (sortWidget != null) {
assert(sortPredicate != null);
}
}