SearchableList<T> constructor

SearchableList<T>({
  1. Key? key,
  2. required List<T> initialList,
  3. required Widget itemBuilder(
    1. T item
    )?,
  4. List<T> filter(
    1. String query
    )?,
  5. Widget? loadingWidget,
  6. Widget? errorWidget,
  7. TextEditingController? searchTextController,
  8. TextInputAction keyboardAction = TextInputAction.done,
  9. InputDecoration? inputDecoration,
  10. TextStyle? textStyle,
  11. dynamic onSubmitSearch(
    1. String?
    )?,
  12. SearchMode searchMode = SearchMode.onEdit,
  13. Widget? emptyWidget,
  14. TextInputType textInputType = TextInputType.text,
  15. bool obscureText = false,
  16. FocusNode? focusNode,
  17. bool searchFieldEnabled = true,
  18. double? searchFieldWidth,
  19. double? searchFieldHeight,
  20. bool displayClearIcon = true,
  21. Future<void> onRefresh()?,
  22. Axis scrollDirection = Axis.vertical,
  23. SearchTextPosition searchTextPosition = SearchTextPosition.top,
  24. Future onPaginate()?,
  25. @Deprecated('Deprecated will be removed in the next release, use searchFieldPadding instead') double spaceBetweenSearchAndList = 20,
  26. EdgeInsetsGeometry? searchFieldPadding,
  27. Color? cursorColor,
  28. int? maxLines,
  29. int? maxLength,
  30. TextAlign textAlign = TextAlign.start,
  31. List<String> autoCompleteHints = const [],
  32. Widget? secondaryWidget,
  33. ScrollPhysics? physics,
  34. bool shrinkWrap = false,
  35. double? itemExtent,
  36. EdgeInsetsGeometry? listViewPadding,
  37. bool reverse = false,
  38. int sortPredicate(
    1. T a,
    2. T b
    )?,
  39. Widget? sortWidget,
  40. Widget seperatorBuilder(
    1. BuildContext context,
    2. int index
    )?,
  41. ScrollController? scrollController,
  42. bool closeKeyboardWhenScrolling = false,
  43. bool displaySearchIcon = true,
  44. Color defaultSuffixIconColor = Colors.grey,
  45. double defaultSuffixIconSize = 24,
  46. bool lazyLoadingEnabled = true,
  47. void onChanged(
    1. bool? value
    )?,
  48. 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);
  }
}