SearchableList<T>.expansion constructor
SearchableList<T>.expansion ({
- Key? key,
- required Map<
dynamic, List< expansionListData,T> > - required Widget expansionTitleBuilder(
- dynamic
- required Map<
dynamic, List< filterExpansionData()?,T> > - required Widget expansionListBuilder(
- int expansionGroupIndex,
- T listItem
- TextEditingController? searchTextController,
- TextInputAction keyboardAction = TextInputAction.done,
- InputDecoration? inputDecoration,
- TextStyle? textStyle,
- dynamic onSubmitSearch()?,
- SearchMode searchMode = SearchMode.onEdit,
- Widget? emptyWidget = const SizedBox.shrink(),
- TextInputType textInputType = TextInputType.text,
- bool obscureText = false,
- FocusNode? focusNode,
- bool searchFieldEnabled = true,
- double? searchFieldWidth,
- double? searchFieldHeight,
- bool displayClearIcon = true,
- @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,
- ScrollController? scrollController,
- bool closeKeyboardWhenScrolling = false,
- bool hideEmptyExpansionItems = false,
- bool expansionTileEnabled = true,
- Widget? sortWidget,
- int sortPredicate(
- T a,
- T b
- bool displaySearchIcon = true,
- Color defaultSuffixIconColor = Colors.grey,
- double defaultSuffixIconSize = 24,
- bool lazyLoadingEnabled = true,
- void onChanged(
- bool? value
- 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);
}
}