DropdownController<T> class abstract base

The controller that will be used to control the dropdown menu.

Inheritance
Implementers

Constructors

A multiple selection dropdown controller.
factory
A single selection dropdown controller.
factory

Properties

currentItems List<DropdownItem<T>>
Current items that will be shown in the dropdown menu, see also _currentItemValues.
no setter
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 setter
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
detach() → void
dismiss({VoidCallback? onDismissed}) → void
Dismiss the dropdown menu. if onDismissed is provided, it would be called after the menu is dismissed.
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.
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.
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.
rebuildMenu() → void
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.
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.
inherited
toString() String
A string representation of this object.
inherited

Operators

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