SelectionController class
Manages single or multiple selection states.
Maintains a SelectionSet and notifies the DirectoryTreeController on changes. Supports different modes via SelectionMode:
- SelectionMode.single: Only one node selected at a time.
SelectionMode.multiple: Allows arbitrary collections of nodes.
- Inheritance
-
- Object
- ChangeNotifier
- SelectionController
Constructors
- SelectionController({SelectionMode mode = SelectionMode.single, SelectionSet? state})
- Creates a selection controller.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- mode ↔ SelectionMode
-
The active selection strategy.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectedIds
→ Set<
String> -
The set of currently selected node IDs.
no setter
- state → SelectionSet
-
Returns a snapshot of the current selection state.
no setter
Methods
-
addAll(
Iterable< String> ids) → void -
Add
idsto the current selection. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Deselects all nodes.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
isSelected(
String id) → bool -
Returns true if
idis in the currently selected set. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
performBatch(
void updates()) → void - Perform several selection updates while emitting at most one notification.
-
removeAll(
Iterable< String> ids) → void -
Remove
idsfrom the current selection. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
retainWhere(
bool test(String id)) → void - Keep only ids that still exist in the new tree.
-
selectOnly(
String id) → void -
Deselects everything else and selects
id. -
selectRange(
List< String> orderedVisibleIds, String anchorId, String toId) → void -
Selects a contiguous range of nodes between
anchorIdandtoId. -
toggle(
String id) → void -
Toggles the selection state of
id. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited