GlassMaterializeTransition class
Materializes a glass subtree in or out, driven by an explicit animation — the FadeTransition idiom, for wiring into a route transition, an AnimationController, or an AnimatedSwitcher.
This is SwiftUI's glassEffectTransition(.materialize) from iOS 26: the
glass fades up as it settles inward from slightly oversized, and its
content sharpens only after the shape has resolved. In reverse the order
flips — content first, glass after — which this widget selects from
animation's status, so a reversed controller plays a true exit rather
than a rewound entrance.
An ancestor FadeTransition or ImageFiltered cannot produce this: a glass backdrop pass renders fully or not at all, so fading the layer pops. The effect instead drives the shader's own visibility uniforms, which is the one fade the backdrop pass honours — any glass surface in child participates automatically, whichever rendering tier it is on.
AnimatedSwitcher(
duration: GlassDefaults.materializeDuration,
reverseDuration: GlassDefaults.dematerializeDuration,
transitionBuilder: GlassMaterializeTransition.switcherBuilder,
child: chip,
)
For the common show/hide case driven by a boolean, use GlassMaterialize.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GlassMaterializeTransition
Constructors
Properties
- alignment → Alignment
-
Where the scale converges, matching Transform.scale's alignment.
final
-
animation
→ Animation<
double> -
Drives the transition: 0.0 = fully dematerialized, 1.0 = at rest.
final
- child → Widget
-
The subtree containing the glass to materialize.
final
- contentSigma → double
-
Peak gaussian sigma on the glass content, in logical pixels.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleFrom → double
-
Scale at full dematerialization, from the native capture (~1.15).
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
Static Methods
-
switcherBuilder(
Widget child, Animation< double> animation) → Widget - An AnimatedSwitcher.transitionBuilder that materializes each child.