MultipleSearchSelection<T> class
Constructors
-
MultipleSearchSelection({required TextField searchField, required List<T> items, required Widget pickedItemBuilder(T), required String fieldToCheck(T), required Widget itemBuilder(T, int), void onItemRemoved(T)?, void onItemAdded(T)?, void onPickedChange(List<T>)?, Widget pickedItemsContainerBuilder(List<Widget> pickedItems)?, Key? key, FuzzySearch? fuzzySearch, double? maximumShowItemsHeight, ShowedItemsVisibility? itemsVisibility, List<T>? initialPickedItems, Widget? title, double? showedItemsScrollbarMinThumbLength, Color? showedItemsScrollbarColor, double? showedItemsScrollbarMinOverscrollLength, Radius? showedItemsScrollbarRadius, double? showedItemContainerHeight, EdgeInsets? showedItemContainerPadding, bool? showShowedItemsScrollbar, bool? showSelectAllButton, bool? showClearAllButton, Widget? noResultsWidget, double? pickedItemSpacing, double? pickedItemsContainerMaxHeight, double? pickedItemsContainerMinHeight, Color? pickedItemsScrollbarColor, double? pickedItemsScrollbarThickness, double? pickedItemsScrollbarMinOverscrollLength, Radius? pickedItemsScrollbarRadius, double? pickedItemsScrollbarMinThumbLength, BoxDecoration? pickedItemsBoxDecoration, bool? showPickedItemScrollbar, VoidCallback? onTapShowedItem, ScrollController? pickedItemsScrollController, ScrollController? showedItemsScrollController, ScrollPhysics? pickedItemsScrollPhysics, ScrollPhysics? showedItemsScrollPhysics, BoxDecoration? showedItemsBoxDecoration, bool? sortPickedItems, bool? sortShowedItems, bool? clearSearchFieldOnSelect, Widget? showItemsButton, VoidCallback? onTapShowItems, Widget? selectAllButton, VoidCallback? onTapSelectAll, Widget? clearAllButton, VoidCallback? onTapClearAll, bool? caseSensitiveSearch, String hintText = 'Type here to search', double? showedItemExtent, int? maxSelectedItems, bool? placePickedItemContainerBelow, MultipleSearchController? controller, dynamic onSearchChanged(String)?})
-
factory
-
MultipleSearchSelection.creatable({required TextField searchField, required List<T> items, required Widget pickedItemBuilder(T), required String fieldToCheck(T), required Widget itemBuilder(T, int), required CreateOptions<T> createOptions, Widget pickedItemsContainerBuilder(List<Widget> pickedItems)?, void onItemRemoved(T)?, void onItemAdded(T)?, dynamic onPickedChange(List<T>)?, Key? key, FuzzySearch? fuzzySearch, double? maximumShowItemsHeight, ShowedItemsVisibility? itemsVisibility, List<T>? initialPickedItems, Widget? title, Color? showedItemsScrollbarColor, double? showedItemsScrollbarMinThumbLength, double? showedItemsScrollbarMinOverscrollLength, Radius? showedItemsScrollbarRadius, double? showedItemContainerHeight, EdgeInsets? showedItemContainerPadding, bool? showShowedItemsScrollbar, bool? showSelectAllButton, bool? showClearAllButton, double? pickedItemSpacing, double? pickedItemsContainerMaxHeight, double? pickedItemsContainerMinHeight, Color? pickedItemsScrollbarColor, double? pickedItemsScrollbarThickness, double? pickedItemsScrollbarMinOverscrollLength, Radius? pickedItemsScrollbarRadius, double? pickedItemsScrollbarMinThumbLength, BoxDecoration? pickedItemsBoxDecoration, bool? showPickedItemScrollbar, VoidCallback? onTapShowedItem, ScrollController? pickedItemsScrollController, ScrollController? showedItemsScrollController, ScrollPhysics? pickedItemsScrollPhysics, ScrollPhysics? showedItemsScrollPhysics, BoxDecoration? showedItemsBoxDecoration, bool? sortPickedItems, bool? sortShowedItems, bool? clearSearchFieldOnSelect, Widget? showItemsButton, VoidCallback? onTapShowItems, Widget? selectAllButton, VoidCallback? onTapSelectAll, Widget? clearAllButton, VoidCallback? onTapClearAll, bool? caseSensitiveSearch, String hintText = 'Type here to search', double? showedItemExtent, int? maxSelectedItems, bool? placePickedItemContainerBelow, MultipleSearchController? controller, dynamic onSearchChanged(String)?})
-
MultipleSearchSelection.creatable constructor provides a way to add a new item in your list,
factory
-
MultipleSearchSelection.overlay({required TextField searchField, required List<T> items, required Widget pickedItemBuilder(T), required String fieldToCheck(T), required Widget itemBuilder(T, int), void onItemRemoved(T)?, void onItemAdded(T)?, void onPickedChange(List<T>)?, Widget pickedItemsContainerBuilder(List<Widget> pickedItems)?, Key? key, FuzzySearch? fuzzySearch, double? maximumShowItemsHeight, OverlayOptions<T>? overlayOptions, List<T>? initialPickedItems, Widget? title, double? showedItemsScrollbarMinThumbLength, Color? showedItemsScrollbarColor, double? showedItemsScrollbarMinOverscrollLength, Radius? showedItemsScrollbarRadius, double? showedItemContainerHeight, EdgeInsets? showedItemContainerPadding, bool? showShowedItemsScrollbar, bool? showSelectAllButton, bool? showClearAllButton, Widget? noResultsWidget, double? pickedItemSpacing, double? pickedItemsContainerMaxHeight, double? pickedItemsContainerMinHeight, Color? pickedItemsScrollbarColor, double? pickedItemsScrollbarThickness, double? pickedItemsScrollbarMinOverscrollLength, Radius? pickedItemsScrollbarRadius, double? pickedItemsScrollbarMinThumbLength, BoxDecoration? pickedItemsBoxDecoration, bool? showPickedItemScrollbar, VoidCallback? onTapShowedItem, ScrollController? pickedItemsScrollController, ScrollController? showedItemsScrollController, ScrollPhysics? pickedItemsScrollPhysics, ScrollPhysics? showedItemsScrollPhysics, BoxDecoration? showedItemsBoxDecoration, bool? sortPickedItems, bool? sortShowedItems, bool? clearSearchFieldOnSelect, Widget? showItemsButton, VoidCallback? onTapShowItems, Widget? selectAllButton, VoidCallback? onTapSelectAll, Widget? clearAllButton, VoidCallback? onTapClearAll, bool? caseSensitiveSearch, String hintText = 'Type here to search', double? showedItemExtent, int? maxSelectedItems, bool? placePickedItemContainerBelow, MultipleSearchController? controller, dynamic onSearchChanged(String)?})
-
MultipleSearchSelection.overlay is a widget that can be used to show the search results in an overlay.
factory
Properties
-
caseSensitiveSearch
→ bool
-
Whether the search is case sensitive. Defaults to
false
.
final
-
clearAllButton
→ Widget?
-
The clear all selected items button widget. Ontap logic is already defined and you can't override it with
final
-
clearSearchFieldOnSelect
→ bool?
-
Whether to clear the searchfield and reset the showed items when you pick an item. Defaults to
false
.
final
-
controller
→ MultipleSearchController?
-
This is the controller for the MultipleSearchSelection.
final
-
createOptions
→ CreateOptions<T>?
-
The CreateOptions of the creatable widget.
final
-
fieldToCheck
→ String Function(T)
-
This is the field to check when searching & sorting the List
final
-
fuzzySearch
→ FuzzySearch?
-
Fuzzy search functionality. Defaults to FuzzySearch.none.
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
hintText
→ String
-
Hint text to display in the text input
final
-
initialPickedItems
→ List<T>?
-
The list of initial picked items.
final
-
isCreatable
→ bool
-
Whether the widget is creatable style.
final
-
isOverlay
→ bool
-
Whether widget is of type MultipleSearchSelection.overlay
final
-
itemBuilder
→ Widget Function(T, int)
-
This is the builder of showed items.
final
-
items
→ List<T>?
-
The list of items (T) to search and select.
final
-
itemsVisibility
→ ShowedItemsVisibility?
-
How the showed items are displayed.
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
maximumShowItemsHeight
→ double
-
The maximum height constraints of the items' container.
final
-
maxSelectedItems
→ int?
-
The maximum number of items that can be picked. If null, there is no limit.
final
-
noResultsWidget
→ Widget?
-
What is shown when there are no more results to select.
final
-
onItemAdded
→ (dynamic Function(T)?)
-
A callback when an item is added, returns the item aswell.
final
-
onItemRemoved
→ (dynamic Function(T)?)
-
A callback when an item is removed, returns the item aswell.
final
-
onPickedChange
→ (dynamic Function(List<T>)?)
-
A callback when user selects or deselects an item. Always returns the currently picked items.
final
-
onSearchChanged
→ (dynamic Function(String)?)
-
Since the
onChanged
of the searchField
is used internally to search items,
you can use this callback to get the search query.
final
-
onTapClearAll
→ VoidCallback?
-
A callback when the clear all button is pressed.
final
-
onTapSelectAll
→ VoidCallback?
-
A callback when the select all button is pressed.
final
-
onTapShowedItem
→ VoidCallback?
-
A callback when a showed item is tapped.
final
-
onTapShowItems
→ VoidCallback?
-
A callback when the select all button is pressed.
final
-
overlayOptions
→ OverlayOptions<T>?
-
Provide overlay options here to customise its behaviour.
final
-
pickedItemBuilder
→ Widget Function(T)
-
This is the builder of each picked item.
final
-
pickedItemsBoxDecoration
→ BoxDecoration?
-
The BoxDecoration of the picked items container.
final
-
pickedItemsContainerBuilder
→ (Widget Function(List<Widget> pickedItems)?)
-
This is the builder of the whole picked items container.
final
-
pickedItemsContainerMaxHeight
→ double?
-
The maximum height of which the picked items container can extend. Defaults to 150 pixels.
final
-
pickedItemsContainerMinHeight
→ double?
-
The minimum height of which the picked items container can extend. Defaults to 50 pixels.
final
-
pickedItemSpacing
→ double?
-
The spacing of the picked item. Defaults to 5.
final
-
pickedItemsScrollbarColor
→ Color?
-
The thumb color of the picked items' scrollbar.
final
-
pickedItemsScrollbarMinOverscrollLength
→ double?
-
The minimum length of the overscroll for picked items.
final
-
pickedItemsScrollbarMinThumbLength
→ double?
-
The minimum length of the picked items' scrollbar thumb.
final
-
pickedItemsScrollbarRadius
→ Radius?
-
The radius of the picked items' scrollbar.
final
-
pickedItemsScrollbarThickness
→ double?
-
The thickness of the picked items' scrollbar thumb.
final
-
pickedItemsScrollController
→ ScrollController?
-
The ScrollController of the picked items list.
final
-
pickedItemsScrollPhysics
→ ScrollPhysics?
-
The ScrollPhysics of the picked items list.
final
-
placePickedItemContainerBelow
→ bool
-
Place the pickedItemsContainer bottom of the search box
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
searchField
→ TextField
-
The TextField that is used to search items.
final
-
selectAllButton
→ Widget?
-
The select all button widget. Ontap logic is already defined and you can't override it with
final
-
showClearAllButton
→ bool?
-
Hide or show clear all button, defaults to
true
.
final
-
showedItemContainerHeight
→ double?
-
The height of the showed item container. Defaults to 50 pixels.
final
-
showedItemContainerPadding
→ EdgeInsets?
-
The padding of the showed item container.
final
-
showedItemExtent
→ double?
-
When we have very large lists with dynamic content,
unfortunately there is an open issue in flutter that causes the list to be very slow when
scrolled with the srollbar.
final
-
showedItemsBoxDecoration
→ BoxDecoration?
-
The BoxDecoration of the showed items container.
final
-
showedItemsScrollbarColor
→ Color?
-
The thumb color of the items' scrollbar.
final
-
showedItemsScrollbarMinOverscrollLength
→ double?
-
The minimum length of the overscroll for items.
final
-
showedItemsScrollbarMinThumbLength
→ double?
-
The minimum length of the items' scrollbar thumb.
final
-
showedItemsScrollbarRadius
→ Radius?
-
The radius of the items' scrollbar.
final
-
showedItemsScrollController
→ ScrollController?
-
The ScrollController of showed items list.
final
-
showedItemsScrollPhysics
→ ScrollPhysics?
-
The ScrollPhysics of showed items list.
final
-
showItemsButton
→ Widget?
-
The toggle items button when itemsVisibility == ShowedItemsVisibility.toggle. Ontap logic is already defined and you can't override it with
final
-
showPickedItemScrollbar
→ bool?
-
Hide or show picked items' scrollbar, defaults to
true
.
final
-
showSelectAllButton
→ bool?
-
Hide or show select all button, defaults to
true
.
final
-
showShowedItemsScrollbar
→ bool?
-
Hide or show items' scrollbar, defaults to
true
.
final
-
sortPickedItems
→ bool
-
Whether the picked items are sorted alphabetically. Defaults to
false
.
final
-
sortShowedItems
→ bool?
-
Whether the showed items are sorted alphabetically. Defaults to
false
.
final
-
title
→ Widget?
-
The title widget on top of the picked items.
final