SelectionScope class
Publishes the ambient SelectionRegistrar to the subtree — a
Scope<SelectionRegistrar>.
Used by Selectable widgets at mount time to find the area they
belong to. The registrar reference is stable for the lifetime of
the surrounding SelectionArea, so maybeOf reads it without a
rebuild dependency: callers only register / deregister and must not
rebuild on registrar identity changes.
Pass registrar: null to mask a deeper subtree from any
ancestor SelectionArea — useful for forms or interactive panels
embedded inside a selectable region that shouldn't themselves
participate in selection. Read the registrar through maybeOf: a
direct context.scope<SelectionRegistrar>() below a masked subtree returns
the no-op registrar that stands in for null, not null itself.
- Inheritance
-
- Object
- Widget
- ProxyWidget
- Scope<
SelectionRegistrar> - SelectionScope
- Available extensions
Constructors
- SelectionScope({Key? key, required SelectionRegistrar? registrar, required Widget child})
-
registraris the registrar that ought to own Selectables in this subtree, ornullto disable selection for the subtree (Selectables there see no ambient registrar and silently no-op).const
Properties
Methods
-
animate(
{Duration? duration, Curve? curve, Object? trigger, bool repeat = false}) → Animate -
Available on Widget, provided by the AnimateExtension extension
Starts an Animate chain over this widget.duration/curveapply to the whole chain. With notriggerit plays on mount; with a non-null trigger it rests on mount and replays whenever the token changes. -
createElement(
) → ScopeElement< SelectionRegistrar> -
Creates the Element that will mount this widget into the tree.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
covariant Scope< SelectionRegistrar> oldWidget) → bool -
Whether replacement of this widget should rebuild its readers.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
maybeOf(
BuildContext context) → SelectionRegistrar? - Looks up the ambient registrar without subscribing to changes. Returns null when no SelectionScope is in scope OR when the nearest scope's registrar is null — Selectables under either condition silently no-op their registration.