SearchableList<T>.expansion constructor

SearchableList<T>.expansion({
  1. Key? key,
  2. required Map<dynamic, List<T>> expansionListData,
  3. required Widget expansionTitleBuilder(
    1. dynamic
    ),
  4. required Map<dynamic, List<T>> filterExpansionData(
    1. String
    )?,
  5. required Widget expansionListBuilder(
    1. int expansionGroupIndex,
    2. T listItem
    )?,
  6. TextEditingController? searchTextController,
  7. TextInputAction keyboardAction = TextInputAction.done,
  8. InputDecoration? inputDecoration,
  9. TextStyle? textStyle,
  10. dynamic onSubmitSearch(
    1. String?
    )?,
  11. SearchMode searchMode = SearchMode.onEdit,
  12. Widget? emptyWidget = const SizedBox.shrink(),
  13. TextInputType textInputType = TextInputType.text,
  14. bool obscureText = false,
  15. FocusNode? focusNode,
  16. bool searchFieldEnabled = true,
  17. double? searchFieldWidth,
  18. double? searchFieldHeight,
  19. bool displayClearIcon = true,
  20. @Deprecated('Deprecated will be removed in the next release, use searchFieldPadding instead') double spaceBetweenSearchAndList = 20,
  21. EdgeInsetsGeometry? searchFieldPadding,
  22. Color? cursorColor,
  23. int? maxLines,
  24. int? maxLength,
  25. TextAlign textAlign = TextAlign.start,
  26. List<String> autoCompleteHints = const [],
  27. Widget? secondaryWidget,
  28. ScrollPhysics? physics,
  29. bool shrinkWrap = false,
  30. double? itemExtent,
  31. EdgeInsetsGeometry? listViewPadding,
  32. bool reverse = false,
  33. ScrollController? scrollController,
  34. bool closeKeyboardWhenScrolling = false,
  35. bool hideEmptyExpansionItems = false,
  36. bool expansionTileEnabled = true,
  37. Widget? sortWidget,
  38. int sortPredicate(
    1. T a,
    2. T b
    )?,
  39. bool displaySearchIcon = true,
  40. Color defaultSuffixIconColor = Colors.grey,
  41. double defaultSuffixIconSize = 24,
  42. bool lazyLoadingEnabled = true,
  43. void onChanged(
    1. bool? value
    )?,
  44. required List<T> selectedList,
})

Implementation

SearchableList.expansion({
  Key? key,
  required this.expansionListData,
  required this.expansionTitleBuilder,
  required this.filterExpansionData,
  required this.expansionListBuilder,
  this.searchTextController,
  this.keyboardAction = TextInputAction.done,
  this.inputDecoration,
  this.textStyle,
  this.onSubmitSearch,
  this.searchMode = SearchMode.onEdit,
  this.emptyWidget = const SizedBox.shrink(),
  this.textInputType = TextInputType.text,
  this.obscureText = false,
  this.focusNode,
  this.searchFieldEnabled = true,
  this.searchFieldWidth,
  this.searchFieldHeight,
  this.displayClearIcon = true,
  @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.scrollController,
  this.closeKeyboardWhenScrolling = false,
  this.hideEmptyExpansionItems = false,
  this.expansionTileEnabled = true,
  this.sortWidget,
  this.sortPredicate,
  this.displaySearchIcon = true,
  this.defaultSuffixIconColor = Colors.grey,
  this.defaultSuffixIconSize = 24,
  this.lazyLoadingEnabled = true,
  // this.isSelectALL,
  this.onChanged,
  required this.selectedList,
}) : super(key: key) {
  searchTextController ??= TextEditingController();
  seperatorBuilder = null;
  isExpansionList = true;
  //! use itemBuiler instead of expansionTitleBuilder and expansionListBuilder
  itemBuilder = null;
  initialList = [];
  if (sortWidget != null) {
    assert(sortPredicate != null);
  }
}