ShaderGlassSurface class

Glass rendered with a fragment shader over the backdrop.

Requires Impeller (ui.ImageFilter.isShaderFilterSupported). Callers should check isSupported and fall back to FallbackGlassSurface otherwise.

Inheritance

Constructors

ShaderGlassSurface({required Glass glass, required GlassShape shape, required Widget child, double intensity = 1.0, double thickness = 0.6, double refraction = 1.35, double blurSigma = 12, double lightAngle = -1.2, Key? key})
Creates a shader-rendered glass surface. The physical parameters default to the values fresnel's theme uses, so this is usable standalone.
const

Properties

blurSigma double
Gaussian sigma applied under the shader, in logical pixels. Runs as a composed ui.ImageFilter.blur because Flutter's separable pass beats any multi-tap loop written in the fragment shader.
final
child Widget
Content composited above the material. Also what sizes the surface: the shader region is measured from the child, not from incoming constraints.
final
glass Glass
The material. Glass.identity renders child untouched.
final
hashCode int
The hash code for this object.
no setterinherited
intensity double
System glass intensity, 0–1. Scales the whole effect toward "off" so this surface tracks the OS preference the way native glass does.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lightAngle double
Direction of the specular highlight, in radians. Matches Apple's top-leading key light by default; changing it per surface breaks the illusion that one light source lit the whole screen.
final
refraction double
Index-of-refraction analogue. Higher bends edge samples further; past roughly 2.0 the lensing reads as a defect rather than glass.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape GlassShape
Outline the surface is clipped to, and the shape the signed-distance field is built from — refraction follows this edge.
final
thickness double
How deep the slab reads, 0–1. Drives the falloff that stops the surface looking like a decal.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ShaderGlassSurface>
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 Properties

isSupported bool
Whether this renderer can run at all. False on Skia and web, where callers must use FallbackGlassSurface instead.
no setter