Stage class

Inheritance

Constructors

Stage({Key? key, required Widget child, Map<DragStart, DragGesture>? drag, Map<ScaleStart, ScaleGesture>? scale, GestureConstraints? constraints, OnRelease? onRelease, OnStageTap? onTap, OnStageTap? onDoubleTap, double? doubleTapPullFactor, DragPromote? dragPromote, double? scaleVelocityCancel, Overrides? overrides, WidgetBuilder? overlay, DragHybrid? dragHybridFromStage, ScaleHybrid? scaleHybridFromStage})
const

Properties

child Widget
final
constraints GestureConstraints?
Stage-level fallback constraints (per-field cascade).
final
doubleTapPullFactor double?
Pan tuning for the bundled zoomToggleOnDoubleTap handler when it transitions from base to fit-cover-at-focal. Cascade: DisplayConfig.doubleTapPullFactor → this → package default (0.4). Has no effect unless zoomToggleOnDoubleTap is wired in to onDoubleTap on this stage or the active DisplayConfig.
final
drag Map<DragStart, DragGesture>?
Stage-level fallback drag gestures. Origins under this Stage cascade through their own Origin.drag first, then this map for any unhandled keys.
final
dragHybridFromStage DragHybrid?
Stage-level cascade fallback for how new pointers are handled during an active gesture (see DragGesture.hybridFromStage / ScaleGesture.hybridFromStage). Final fallback before DragHybrid.lock / ScaleHybrid.lock.
final
dragPromote DragPromote?
Stage-level fallback for displayed-state drag→scale promotion when a 2nd pointer is added. Cascade: per-gesture > displayConfig > this > DragPromote.scale default.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDoubleTap OnStageTap?
Stage-level fallback for displayed-state double-tap. Resolved as: DisplayConfig.onDoubleTap → this. Both null means no DoubleTapGestureRecognizer is registered — so single-tap fires on the up event without waiting for the double-tap timeout. Pass Stage.zoomToggleOnDoubleTap explicitly to opt in to the baseRect ↔ fit-cover-at-focal toggle.
final
onRelease OnRelease?
Top-level onRelease fallback. Resolved last in both Stage and Origin gesture-end cascades.
final
onTap OnStageTap?
Stage-level fallback for displayed-state single-tap. Resolved as: DisplayConfig.onTap → this → package default (no-op). Use this for global tap behavior (e.g. dismiss-on-outside) that all displayed configs inherit unless they override.
final
overlay WidgetBuilder?
Builder for an optional consumer-provided overlay rendered above the displayed origin and Stage's own overlay/scrim. Use it to add mode-aware UI (e.g., a crop tool's appbar). Read Stage.of to inspect displayConfig() and decide what to render. The builder is invoked on every Stage rebuild — consumer owns any animations (e.g. AnimatedSwitcher / AnimatedOpacity) around its output.
final
overrides Overrides?
Top-level escape hatches for advanced behavioral customization. Resolved last in the per-field overrides cascade (gesture-context- specific levels first, Stage as final fallback).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale Map<ScaleStart, ScaleGesture>?
Stage-level fallback scale gestures.
final
scaleHybridFromStage ScaleHybrid?
final
scaleVelocityCancel double?
Stage-level strength of scale-velocity-based translation cancellation in [0, 1]. Threaded into ReleaseContext.scaleVelocityCancel by the package's built-in release paths. Default 0.8.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<Stage>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

hasWidgetOf(BuildContext context) bool
isActiveOf(BuildContext context, Object tag) bool
isDismissingOf(BuildContext context) bool
isInteractingOf(BuildContext context, [Object? tag]) bool
Coarse "is the user touching the stage right now?" signal.
isLockedOf(BuildContext context) bool
isTagOf(BuildContext context, Object tag) bool
of(BuildContext context) StageData
stateOf(BuildContext context, Object tag) TagState
tagOf(BuildContext context) Object?
widgetOf(BuildContext context) Widget?

Constants

zoomToggleOnDoubleTap → const OnStageTap
Sentinel handler — pass to onDoubleTap (here or on a DisplayConfig) to opt in to the package's default zoom toggle (baseRect ↔ fit-cover-at-focal at the tap position). Detected by identity inside Stage so the implementation can use the live Stage instance to animate the rect; invoking this function directly is a no-op.