MultiSelectDialog<T> class

A dialog containing either a classic checkbox style list, or a chip style list.

Inheritance
Mixed in types

Constructors

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

Properties

backgroundColor Color?
The background color of the dialog.
final
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
height double?
Sets a fixed height on the dialog.
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
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. Default is false.
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 dialog.
final
unselectedColor Color?
The color of the chip body or checkbox border while not selected.
final
width double?
Sets a fixed width on the dialog.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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