MultiSelectionDropdownController<T> class final

Inheritance

Constructors

MultiSelectionDropdownController({bool? unselectable, List<DropdownItem<T>>? items})

Properties

currentItems List<DropdownItem<T>>
Current items that will be shown in the dropdown menu, see also _currentItemValues.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isOpen bool
Whether the dropdown menu is open/showing.
no setterinherited
loading bool
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
attach(DropdownOverlayBuilderDelegate<StatefulWidget> state) → void
inherited
detach() → void
inherited
dismiss({VoidCallback? onDismissed}) → void
Dismiss the dropdown menu. if onDismissed is provided, it would be called after the menu is dismissed.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getAllSelectedItems() List<DropdownItem<T>>
All selected items, for SingleSelectionDropdownController, it would be the current selected item; for MultiSelectionDropdownController, it would be all selected items.
override
getLastSelected() DropdownItem<T>?
The last selected item, for SingleSelectionDropdownController, it would be the current selected item; for MultiSelectionDropdownController, it would be the last selected item.
override
load(DropdownItemLoader<T> loader, {bool replace = false, bool onException(Object)?}) Future<void>
Load the items from the given loader, and set the items to the dropdown menu. The loaded items would replace the current items if replace is true; otherwise, the loaded items would be merged with the current items. if onException is provided, it would be called when an exception is thrown during the loading.
inherited
markAsLoaded() → void
inherited
markAsLoading() → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
open({VoidCallback? onOpened}) → void
Open the dropdown menu. if onOpened is provided, it would be called after the menu is opened.
inherited
rebuildMenu() → void
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
restore({bool onlyOnce = false}) → void
Restore the items to the previous state. if onlyOnce, it would try to pop the history once to show the previous history result; otherwise, it would clear all history and show the original items.
inherited
Search the loaded items that match the given query, and set the matched items to the dropdown menu. It would be marked as a history without modifying the original items.
inherited
select(T? value, {bool dismiss = true, bool refresh = true}) → void
Select the given value. if dismiss, the menu will be dismissed no matter the value is selected or not. if refresh, the menu will be rebuilt after the value is selected.
override
setAsHistoryItems(Object key, List<DropdownItem<T>> items, {bool rebuild = false}) → void
Set the given items to the dropdown menu as history items, it would be set as the top history. if rebuild, the menu will be rebuilt after the items are set.
inherited
setItems(List<DropdownItem<T>> items, {bool replace = false, bool rebuild = true}) → void
Set the given items to the dropdown menu. if replace, the current items will be replaced with the given items, and all history will be cleared. if rebuild, the menu will be rebuilt after the items are set.
override
toString() String
A string representation of this object.
inherited

Operators

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