MorphingSurface class

Base surface widget that renders an animated morphing container.

Handles:

Used internally by MorphingCard and the overlay system.

This widget renders via a positioned Stack and uses Transform + RepaintBoundary for performance isolation — no full widget rebuilds during animation.

Inheritance

Constructors

MorphingSurface({Key? key, required double progress, required Rect startRect, required Rect endRect, required Widget collapsedBuilder(BuildContext context, double progress), required Widget expandedBuilder(BuildContext context, double progress), double startRadius = 16.0, double endRadius = 0.0, double maxElevation = 12.0, Color? surfaceColor, Color? scrimColor, Clip clipBehavior = Clip.antiAlias})
const

Properties

clipBehavior Clip
final
collapsedBuilder Widget Function(BuildContext context, double progress)
Builds content shown in the collapsed / card state.
final
endRadius double
Corner radius at progress 1.0.
final
endRect Rect
The destination bounding rect (global coordinates).
final
expandedBuilder Widget Function(BuildContext context, double progress)
Builds content shown in the expanded / fullscreen state.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxElevation double
Maximum shadow elevation (achieved at ~progress 0.5).
final
progress double
Morph progress: 0.0 = fully collapsed (at startRect), 1.0 = fully expanded (at endRect).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrimColor Color?
Scrim color. Defaults to semi-transparent black.
final
startRadius double
Corner radius at progress 0.0.
final
startRect Rect
The source bounding rect (global coordinates).
final
surfaceColor Color?
Surface / card background color. Defaults to ColorScheme.surface.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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