MultiDropdown<T extends Object> class
A multiselect dropdown widget.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MultiDropdown
Constructors
-
MultiDropdown({required List<
DropdownItem< items, FieldDecoration fieldDecoration = const FieldDecoration(), DropdownDecoration dropdownDecoration = const DropdownDecoration(), SearchFieldDecoration searchDecoration = const SearchFieldDecoration(), DropdownItemDecoration dropdownItemDecoration = const DropdownItemDecoration(), AutovalidateMode autovalidateMode = AutovalidateMode.disabled, bool singleSelect = false, Widget? itemSeparator, MultiSelectController<T> >T> ? controller, String? validator(List<DropdownItem< ? selectedOptions)?, DropdownItemBuilder<T> >T> ? itemBuilder, bool enabled = true, ChipDecoration chipDecoration = const ChipDecoration(), bool searchEnabled = false, int maxSelections = 0, SelectedItemBuilder<T> ? selectedItemBuilder, FocusNode? focusNode, OnSelectionChanged<T> ? onSelectionChange, OnSearchChanged? onSearchChange, bool closeOnBackButton = false, double? fieldMaxHeight, Key? key}) -
Creates a multiselect dropdown widget.
const
-
MultiDropdown.asyncSearch({required Future<
List< search(String search)?, Duration? searchDebounceDuration = const Duration(milliseconds: 300), FieldDecoration fieldDecoration = const FieldDecoration(), DropdownDecoration dropdownDecoration = const DropdownDecoration(), SearchFieldDecoration searchDecoration = const SearchFieldDecoration(), DropdownItemDecoration dropdownItemDecoration = const DropdownItemDecoration(), AutovalidateMode autovalidateMode = AutovalidateMode.disabled, bool singleSelect = false, Widget? itemSeparator, MultiSelectController<DropdownItem< >T> >T> ? controller, String? validator(List<DropdownItem< ? selectedOptions)?, DropdownItemBuilder<T> >T> ? itemBuilder, bool enabled = true, ChipDecoration chipDecoration = const ChipDecoration(), int maxSelections = 0, SelectedItemBuilder<T> ? selectedItemBuilder, FocusNode? focusNode, OnSelectionChanged<T> ? onSelectionChange, bool closeOnBackButton = false, Widget loadingBuilder(BuildContext context)?, double? fieldMaxHeight, Key? key}) -
const
-
MultiDropdown.future({required FutureRequest<
T> ? future, FieldDecoration fieldDecoration = const FieldDecoration(), DropdownDecoration dropdownDecoration = const DropdownDecoration(), SearchFieldDecoration searchDecoration = const SearchFieldDecoration(), DropdownItemDecoration dropdownItemDecoration = const DropdownItemDecoration(), AutovalidateMode autovalidateMode = AutovalidateMode.disabled, bool singleSelect = false, Widget? itemSeparator, MultiSelectController<T> ? controller, String? validator(List<DropdownItem< ? selectedOptions)?, DropdownItemBuilder<T> >T> ? itemBuilder, bool enabled = true, ChipDecoration chipDecoration = const ChipDecoration(), bool searchEnabled = false, int maxSelections = 0, SelectedItemBuilder<T> ? selectedItemBuilder, FocusNode? focusNode, OnSelectionChanged<T> ? onSelectionChange, OnSearchChanged? onSearchChange, bool closeOnBackButton = false, Widget loadingBuilder(BuildContext context)?, double? fieldMaxHeight, Key? key}) -
Creates a multiselect dropdown widget with future request.
const
Properties
- autovalidateMode → AutovalidateMode
-
The autovalidate mode for the dropdown.
final
- chipDecoration → ChipDecoration
-
The configuration for the chips.
final
- closeOnBackButton → bool
-
Whether to close the dropdown when the back button is pressed.
final
-
controller
→ MultiSelectController<
T> ? -
The controller for the dropdown.
final
- dropdownDecoration → DropdownDecoration
-
The decoration of the dropdown.
final
- dropdownItemDecoration → DropdownItemDecoration
-
The decoration of the dropdown items.
final
- enabled → bool
-
Whether the dropdown is enabled.
final
- fieldDecoration → FieldDecoration
-
The decoration of the field.
final
- fieldMaxHeight → double?
-
final
- focusNode → FocusNode?
-
The focus node for the dropdown.
final
-
future
→ FutureRequest<
T> ? -
The future request for the dropdown items.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
itemBuilder
→ DropdownItemBuilder<
T> ? -
The builder for the dropdown items.
final
-
items
→ List<
DropdownItem< T> > -
The list of dropdown items.
final
- itemSeparator → Widget?
-
The separator between the dropdown items.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingBuilder → Widget Function(BuildContext context)?
-
final
- maxSelections → int
-
The maximum number of selections allowed.
final
- onSearchChange → OnSearchChanged?
-
The callback when the search field value changes.
final
-
onSelectionChange
→ OnSelectionChanged<
T> ? -
The callback when the item is changed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
search
→ Future<
List< Function(String search)?DropdownItem< >T> > -
final
- searchDebounceDuration → Duration?
-
final
- searchDecoration → SearchFieldDecoration
-
The decoration of the search field.
final
- searchEnabled → bool
-
Whether the search field is enabled.
final
-
selectedItemBuilder
→ SelectedItemBuilder<
T> ? -
The builder for the selected items.
final
- singleSelect → bool
-
The selection type of the dropdown.
final
-
validator
→ String? Function(List<
DropdownItem< ? selectedOptions)?T> > -
The validator for the dropdown.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MultiDropdown< 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