MorphTargetSpec class

Description of a flight target: how to compute its rect from the current overlay size (re-evaluated every frame - the target is live; a window resize or the keyboard retargets it automatically) and what surface it has.

The surface model is the same MorphSurfaceSpec as on the source side: one vocabulary describes buttons and their destinations, so an app's named archetypes serve both ends of a flight. When surface is set it wins over the individual fields (mirroring MorphTag.spec); inside the shuttle the target content can read the resolved model back via MorphTag.specOf.

Constructors

MorphTargetSpec({required Rect rectFor(Size overlaySize, EdgeInsets viewPadding), MorphSurfaceSpec? surface, ShapeBorder shape = const RoundedRectangleBorder(), Color? surfaceColor, double elevation = 24, Alignment contentAlignment = Alignment.topCenter})
Creates a target from a live rectFor and a surface model.
MorphTargetSpec.dialog({double width = 440, double height = 360, double margin = 24, MorphSurfaceSpec? surface, ShapeBorder? shape, Color? surfaceColor})
A centered dialog of at most width x height.
factory
MorphTargetSpec.fullscreen({MorphSurfaceSpec? surface, ShapeBorder? shape, Color? surfaceColor})
The container-transform destination: the whole screen. The bread and butter of MorphPageRoute - a card that becomes a page.
factory
MorphTargetSpec.popover({required Rect anchor, Size size = const Size(260, 300), double gap = 10, double margin = 12, MorphSurfaceSpec? surface, ShapeBorder? shape, Color? surfaceColor})
A popover anchored to the control that summoned it (the iOS 26 button-to-menu shape). Prefers sitting below the anchor, flips above when there is no room, and stays inside the overlay with margin. Capture the anchor rect at tap time with morphAnchorRect - it measures in the coordinates of the overlay the flight renders in, so a popover inside a nested navigator stays anchored instead of drifting by the navigator's own offset.
factory
MorphTargetSpec.sheet({double? height, double heightFactor = 0.5, double maxWidth = 560, double margin = 14, MorphSurfaceSpec? surface, ShapeBorder? shape, Color? surfaceColor})
A bottom sheet: full-width up to maxWidth, docked above the bottom safe area.
factory

Properties

contentAlignment Alignment
Which edge the target content is glued to inside the growing container. Top - as in iOS/Material container transforms: the header appears near the origin and the rest "unrolls" downward.
final
elevation double
Container shadow in the fully open state.
final
hashCode int
The hash code for this object.
no setterinherited
rectFor Rect Function(Size overlaySize, EdgeInsets viewPadding)
Computes the destination rect; re-evaluated every frame. The padding argument is MediaQuery.padding (safe areas) - keyboard insets are not available here, keyboard avoidance belongs in the content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape ShapeBorder
The destination outline.
final
surface MorphSurfaceSpec
The target's surface model as a value.
no setter
surfaceColor Color?
The destination surface color; null adopts colorScheme.surfaceContainerHigh.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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