MultiSelectorBottomSheet<T> class
A customizable bottom sheet widget for selecting multiple items.
Provides the same functionality as MultiSelectorDialog but presented as a modal bottom sheet with Material 3 styling, including a drag handle and rounded top corners.
Basic Usage
MultiSelectorBottomSheet<String>(
items: [MultiSelectorItem("1", "Option 1")],
initialValue: ["1"],
onConfirm: (values) => print(values),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MultiSelectorBottomSheet
Constructors
-
MultiSelectorBottomSheet({Key? key, required List<
MultiSelectorItem< items, required List<T> >T> initialValue, Widget? title, void onConfirm(List<T> )?, bool searchable = false, Text? confirmText, Text? cancelText, Color? selectedColor, String? searchHint, Color? colorBuilder(T)?, Color? backgroundColor, Color? unselectedColor, Icon? searchIcon, Icon? closeSearchIcon, TextStyle? itemsTextStyle, TextStyle? selectedItemsTextStyle, TextStyle? searchTextStyle, TextStyle? searchHintStyle, bool separateSelectedItems = false, Color? checkColor, bool showSelectAll = false, String? selectAllText, String? clearAllText, bool useChipsForSelection = false, double? heightFraction, bool showDragHandle = true}) -
Creates a multi-selection bottom sheet.
const
Properties
- backgroundColor → Color?
-
Background color of the bottom sheet.
final
- cancelText → Text?
-
Custom text for the cancel button. Defaults to "CANCEL".
final
- checkColor → Color?
-
Color of the checkbox checkmark.
final
- clearAllText → String?
-
Text for the Clear All button. Defaults to "Clear All".
final
- closeSearchIcon → Icon?
-
Custom icon for closing search.
final
- colorBuilder → Color? Function(T)?
-
Optional builder for custom per-item colors.
final
- confirmText → Text?
-
Custom text for the confirm button. Defaults to "DONE".
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- heightFraction → double?
-
Height of the bottom sheet as a fraction of screen height (0.0 to 1.0).
Defaults to 0.6 (60%).
final
-
initialValue
→ List<
T> -
The initially selected values (must match values in items).
final
-
items
→ List<
MultiSelectorItem< T> > -
The list of items available for selection.
final
- itemsTextStyle → TextStyle?
-
Text style for unselected items.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onConfirm
→ void Function(List<
T> )? -
Callback invoked when selection is confirmed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchable → bool
-
Whether to enable search functionality (defaults to false).
final
- searchHint → String?
-
Hint text displayed in the search field.
final
- searchHintStyle → TextStyle?
-
Text style for search hint text.
final
- searchIcon → Icon?
-
Custom icon for the search button.
final
- searchTextStyle → TextStyle?
-
Text style for search input text.
final
- selectAllText → String?
-
Text for the Select All button. Defaults to "Select All".
final
- selectedColor → Color?
-
The color used for selected items (defaults to theme primary color).
final
- selectedItemsTextStyle → TextStyle?
-
Text style for selected items.
final
- separateSelectedItems → bool
-
Whether to group selected items separately (defaults to false).
final
- showDragHandle → bool
-
Whether to show the drag handle at the top. Defaults to true.
final
- showSelectAll → bool
-
Whether to show Select All / Clear All button (defaults to false).
final
- title → Widget?
-
Optional title widget displayed at the top of the sheet.
final
- unselectedColor → Color?
-
Color for unselected items.
final
- useChipsForSelection → bool
-
Whether to use chips instead of checkboxes (defaults to false).
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MultiSelectorBottomSheet< 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
-
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, int wrapWidth = 65}) → 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited