SelectionContext class
Selection state for the picker. Mirrors telegram's
TGMediaSelectionContext — ordered list of picked assets, capped
at limit, with check-mark indices that follow the pick order
(1-based to match the on-screen ring numerals).
- Mixed-in types
- Available extensions
Constructors
- SelectionContext({required int limit})
-
Creates an empty selection of at most
limit.
Properties
- count → int
-
How many are picked.
no setter
- disposed → bool
-
Whether dispose has already run.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether there is at least one active listener.
no setterinherited
- isEmpty → bool
-
Whether nothing is picked.
no setter
- isFull → bool
-
Whether limit is reached.
no setter
- limit → int
-
How many assets may be picked.
final
-
picked
→ Iterable<
XAsset> -
The picked assets in pick order.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addDispose(
VoidCallback callback) → void -
Registers a disposal
callback. Ignored if already disposed.inherited -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object notifies its listeners.
inherited
-
dispose(
) → void -
Releases whatever this object holds. Calling it twice is an error.
inherited
-
disposeBy(
Dispose disposer) → void -
Available on Disposable, provided by the DisposableDisposerExtension extension
Adds this object's dispose to another Dispose collector. -
indexOf(
XAsset a) → int? - 1-based index for the on-screen ring numeral, or null if not selected.
-
isSelected(
XAsset a) → bool -
Whether
ais picked. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Notifies all registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
subscribe(
VoidCallback callback) → VoidCallback -
Available on Listenable, provided by the ListenableExtension extension
Addscallbackas listener and returns a function to remove it. -
toggle(
XAsset a) → bool - Toggle selection. Returns false when adding past the limit.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited