SwayzeSelectionController class

A ControllerBase that keeps track of the active selections in the table.

Selections are divided in two main groups that are defined by its precedence.

User selections

User selections are the selections in which the control is primarily made by swayze. These selections are the result of some user gestures in the grid. It is guaranteed to exist at least one UserSelectionModel in the state at any given time. These selections maintained by am internal ValueNotifier of UserSelectionState, which can be accessed via userSelectionState and updated via updateUserSelections.

Data selections

The selections that are created and maintained outside swayze. May be result of some computation of datas and specific features. To implement these custom selections, override dataSelectionsValueListenable.

See also:

Inheritance
Implemented types

Constructors

SwayzeSelectionController()

Properties

dataSelections Iterable<Selection>
Recover the current list of data selections.
no setter
dataSelectionsValueListenable ValueListenable<Iterable<Selection>>
The ValueListenable that is supposed to maintain a iterable of Selections that are result of some externally imposed rules to render special selections. It is ideal to maintain selections that are result of different data rather than user gestures.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userSelections → _UserSelectionsValueNotifier
Internal ValueNotifier to control UserSelectionState
final
userSelectionsListenable Listenable
no setter
userSelectionState UserSelectionState
Recover the current UserSelectionState
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
override
dispose() → void
When set to be removed, controllers may have listeners and other references that may create memory dead dependency. dispose should drop such references.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
override
toString() String
A string representation of this object.
inherited
updateUserSelections(UserSelectionState stateUpdate(UserSelectionState previousState)) → void
Update the current userSelectionState. The callback stateUpdate receives the actual version of the state and should return the updated version. If the returned state is the same as before, no update is triggered.

Operators

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