MultiSelectorDialogField<V> class

A FormField that displays a multi-select dialog for selecting multiple values.

The MultiSelectorDialogField widget provides a field that when tapped shows a dialog with multiple items that can be selected. Selected items are displayed as chips below the field.

Example:

MultiSelectorDialogField<String>(
  items: [
    MultiSelectorItem("1", "Option 1"),
    MultiSelectorItem("2", "Option 2"),
  ],
  onConfirm: (selected) => print(selected),
  initialValue: ["1"],
)
Inheritance

Constructors

MultiSelectorDialogField({Key? key, required List<MultiSelectorItem<V>> items, required ValueChanged<List<V>> onConfirm, Widget? title, Text? buttonText, Icon? buttonIcon, InputDecoration? decoration, bool isDense = false, Color? selectedColor, bool searchable = false, Text? confirmText, Text? cancelText, String? searchHint, Color colorBuilder(V)?, List<V> initialValue = const [], ShapeBorder? dialogShape, ShapeBorder? fieldShape, Widget buttonBuilder(BuildContext context)?, bool showSelectAll = false, String? selectAllText, String? deselectAllText, double? dialogHeight, double? dialogWidth, Color? barrierColor, Color? backgroundColor, Color? unselectedColor, Color? checkColor, TextStyle? itemsTextStyle, TextStyle? selectedItemsTextStyle, TextStyle? searchTextStyle, TextStyle? searchHintStyle, Icon? searchIcon, Icon? closeSearchIcon, double dialogElevation = 8.0, EdgeInsets? dialogPadding, ValueChanged<List<V>>? onSelectionChanged, FormFieldSetter<List<V>>? onSaved, FormFieldValidator<List<V>>? validator, AutovalidateMode autovalidateMode = AutovalidateMode.disabled})
Creates a MultiSelectorDialogField

Properties

autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
backgroundColor Color?
Background color of the dialog
final
barrierColor Color?
Color of the dialog barrier
final
builder FormFieldBuilder<List<V>>
Function that returns the widget representing this form field.
finalinherited
buttonBuilder Widget Function(BuildContext context)?
Custom builder for the field button
final
buttonIcon Icon?
Icon for the field button
final
buttonText Text?
Text for the field button
final
cancelText Text?
Text for the cancel button
final
checkColor Color?
Color of the checkmark
final
closeSearchIcon Icon?
Icon for closing search
final
colorBuilder Color Function(V)?
Function to build custom color for each value
final
confirmText Text?
Text for the confirm button
final
decoration InputDecoration?
Input decoration for the field
final
deselectAllText String?
Text for deselect all button
final
dialogElevation double
Elevation of the dialog
final
dialogHeight double?
Height of the dialog
final
dialogPadding EdgeInsets?
Padding for the dialog
final
dialogShape ShapeBorder?
Shape of the dialog
final
dialogWidth double?
Width of the dialog
final
enabled bool
Whether the form is able to receive user input.
finalinherited
errorBuilder FormFieldErrorBuilder?
Function that returns the widget representing the error to display.
finalinherited
fieldShape ShapeBorder?
Shape of the field
final
forceErrorText String?
An optional property that forces the FormFieldState into an error state by directly setting the FormFieldState.errorText property without running the validator function.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
initialValue List<V>
The list of selected values before interaction
final
isDense bool
Whether the field should be dense
final
items List<MultiSelectorItem<V>>
List of items available for selection
final
itemsTextStyle TextStyle?
Text style for items
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onConfirm ValueChanged<List<V>>
Callback when selection is confirmed
final
onReset VoidCallback?
An optional method to call when the form field is reset via FormFieldState.reset.
finalinherited
onSaved FormFieldSetter<List<V>>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
onSelectionChanged ValueChanged<List<V>>?
Callback when selection changes
final
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchable bool
Whether the dialog should be searchable
final
searchHint String?
Hint text for the search field
final
searchHintStyle TextStyle?
Text style for search hint
final
searchIcon Icon?
Icon for search field
final
searchTextStyle TextStyle?
Text style for search text
final
selectAllText String?
Text for select all button
final
selectedColor Color?
Color for selected items
final
selectedItemsTextStyle TextStyle?
Text style for selected items
final
showSelectAll bool
Whether to show select all button
final
title Widget?
Title widget for the dialog
final
unselectedColor Color?
Color for unselected items
final
validator FormFieldValidator<List<V>>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() FormFieldState<List<V>>
Creates the mutable state for this widget at a given location in the tree.
inherited
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