MorphGlassPainter class abstract
Renders the glass surfaces of the measured controls.
Without a painter the controls draw flat fills. Install one with
MorphGlassScope and every control below it builds its surfaces from the
painter instead, every frame, behind its content. A control with
several surfaces hands them to buildLayer together; a control with
one surface calls buildSurface for a glass surface and buildFill
for a plain one. The widget either returns is placed exactly at
MorphGlassSurface.bounds, so buildSurface can sample the backdrop
with a BackdropFilter, run a shader or paint anything else.
A surface whose MorphGlassSurface.glass is false is not glass in iOS 27 and must be drawn flat; buildLayer implementations route it to buildFill.
Constructors
- MorphGlassPainter()
-
Creates a painter.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildBody(
BuildContext context, MorphGlassOutline outline, List< MorphGlassSurface> surfaces) → Widget -
Builds the widget that draws one glass body: the
surfacesa control fused into one silhouette, filling the box of their layer, withoutlineits edge in that box's coordinates. -
buildFill(
BuildContext context, MorphGlassSurface surface) → Widget -
Builds the widget that draws the plain
surfaceflat, sized to its bounds. -
buildLayer(
BuildContext context, List< MorphGlassSurface> surfaces, {Widget? content, List<Rect> contentSlots = const [], double spacing = 0, MorphGlassOutline? outline}) → Widget -
Builds one glass layer of a control: its
surfaces, back to front, in a box that fills the layer, with the control'scontentover them. -
buildSurface(
BuildContext context, MorphGlassSurface surface) → Widget -
Builds the widget that draws the glass
surface, sized to its bounds. -
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