MultiSelectBottomSheet<T> class

A bottom sheet widget containing either a classic checkbox style list, or a chip style list.

Inheritance
Mixed in types

Constructors

MultiSelectBottomSheet({required List<MultiSelectItem<T>> items, required List<T> initialValue, Widget? title, void onSelectionChanged(List<T>)?, void onConfirm(List<T>)?, MultiSelectListType? listType, Text? cancelText, Text? confirmText, bool searchable = false, Color? selectedColor, double? initialChildSize, double? minChildSize, double? maxChildSize, Color? colorator(T)?, Color? unselectedColor, Icon? searchIcon, Icon? closeSearchIcon, TextStyle? itemsTextStyle, TextStyle? searchTextStyle, String? searchHint, TextStyle? searchHintStyle, TextStyle? selectedItemsTextStyle, bool separateSelectedItems = false, Color? checkColor})

Properties

cancelText Text?
Text on the cancel button.
final
checkColor Color?
Set the color of the check in the checkbox
final
closeSearchIcon Icon?
Icon button that hides the search field
final
colorator → (Color? Function(T)?)
A function that sets the color of selected items based on their value. It will either set the chip color, or the checkbox color depending on the list type.
final
confirmText Text?
Text on the confirm button.
final
hashCode int
The hash code for this object.
no setterinherited
initialChildSize double?
Set the initial height of the BottomSheet.
final
initialValue List<T>
The list of selected values before interaction.
final
items List<MultiSelectItem<T>>
List of items to select from.
final
itemsTextStyle TextStyle?
Style the text on the chips or list tiles.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listType MultiSelectListType?
An enum that determines which type of list to render.
final
maxChildSize double?
Set the maximum height of the BottomSheet.
final
minChildSize double?
Set the minimum height threshold of the BottomSheet before it closes.
final
onConfirm → (void Function(List<T>)?)
Fires when confirm is tapped.
final
onSelectionChanged → (void Function(List<T>)?)
Fires when the an item is selected / unselected.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchable bool
Toggles search functionality.
final
searchHint String?
Set the placeholder text of the search field.
final
searchHintStyle TextStyle?
Style the search hint.
final
searchIcon Icon?
Icon button that shows the search field.
final
searchTextStyle TextStyle?
Style the search text.
final
selectedColor Color?
Sets the color of the checkbox or chip when it's selected.
final
selectedItemsTextStyle TextStyle?
Style the text on the selected chips or list tiles.
final
separateSelectedItems bool
Moves the selected items to the top of the list.
final
title Widget?
The text at the top of the BottomSheet.
final
unselectedColor Color?
Color of the chip body or checkbox border while not selected.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _MultiSelectBottomSheetState<T>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCancelTap(BuildContext ctx, List<T> initiallySelectedValues) → void
Pops the dialog from the navigation stack and returns the initially selected values.
inherited
onConfirmTap(BuildContext ctx, List<T> selectedValues, dynamic onConfirm(List<T>)?) → void
Pops the dialog from the navigation stack and returns the selected values. Calls the onConfirm function if one was provided.
inherited
onItemCheckedChange(List<T> selectedValues, T itemValue, bool checked) List<T>
inherited
onSearchTap(bool showSearch) bool
Toggles the search field.
inherited
separateSelected(List<MultiSelectItem<T>> list) List<MultiSelectItem<T>>
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited
updateSearchQuery(String? val, List<MultiSelectItem<T>> allItems) List<MultiSelectItem<T>>
Accepts the search query, and the original list of items. If the search query is valid, return a filtered list, otherwise return the original list.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited