MultiPickerController<T> class
A multi-selection controller.
This class is used to control the selection of a list of items.
It provides methods to select, deselect, toggle, and clear the selection.
It also provides a getter to retrieve the current selection.
The selection is compared using the provided isEquals function.
A typical usage of this class is to create an instance of it and pass it to a widget that needs to manage the selection of a list of items.
- Inheritance
-
- Object
- ChangeNotifier
- MultiPickerController
Constructors
-
MultiPickerController({required bool isEquals(T a, T b), List<
T> ? initialValue}) - Creates a multi-selection controller.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
initialValue
→ List<
T> ? -
final
- isEquals → bool Function(T a, T b)
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
values
↔ List<
T> -
Retrieves the current selection of the controller.
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Clears the selection of the controller.
-
deselect(
T item) → void - Deselects an item.
-
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).
inherited
-
isSelected(
T item) → bool - Checks if the given item is selected.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
select(
T item) → void - Selects an item.
-
toggle(
T item) → void - Toggles the selection of an item.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited