Selectable mixin

A mixin that can be selected by users when under a SelectionArea widget.

This object receives selection events and the value must reflect the current selection in this Selectable. The object must also notify its listener if the value ever changes.

This object is responsible for drawing the selection highlight.

In order to receive the selection event, the mixer needs to register itself to SelectionRegistrars. Use SelectionContainer.maybeOf to get the selection registrar, and mix the SelectionRegistrant to subscribe to the SelectionRegistrar automatically.

This mixin is typically mixed by RenderObjects. The RenderObject.paint methods are responsible to push the LayerLinks provided to pushHandleLayers.

This class returns a SelectionGeometry as its value, and is responsible to notify its listener when its selection geometry has changed as the result of receiving selection events.

See also:

Implemented types

Properties

boundingBoxes List<Rect>
A list of Rects that represent the bounding box of this Selectable in local coordinates.
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
size Size
The size of this Selectable.
no setter
value SelectionGeometry
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
inherited
dispatchSelectionEvent(SelectionEvent event) SelectionResult
Handles the SelectionEvent sent to this object.
inherited
dispose() → void
Disposes resources held by the mixer.
getSelectedContent() SelectedContent?
Gets the selected content in this object.
inherited
getTransformTo(RenderObject? ancestor) Matrix4
Applies the paint transform from this RenderObject to the target RenderObject.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pushHandleLayers(LayerLink? startHandle, LayerLink? endHandle) → void
Marks this handler to be responsible for pushing LeaderLayers for the selection handles.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
inherited
toString() String
A string representation of this object.
inherited

Operators

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