LiquidGlassConfig class

Per-instance shape of the liquid-glass surface.

Translates to liquid_glass_renderer's lgr.LiquidGlassSettings under the hood. All fields have HIG-derived defaults tuned against the iOS 26 Liquid Glass reference; override individually when a single surface needs to deviate from the ambient LiquidGlassTheme.

Annotations

Constructors

LiquidGlassConfig({double thickness = 26.0, double blur = 3.0, double refractiveIndex = 1.28, double chromaticAberration = 0.06, double lightAngle = math.pi * 0.55, double lightIntensity = 0.85, double ambientStrength = 0.18, double saturation = 1.6, Color glassColor = const Color.fromARGB(14, 255, 255, 255), double outerShadowOpacity = 0.10})
Creates a LiquidGlassConfig with explicit values for every field.
const

Properties

ambientStrength double
Ambient highlight intensity (0..1). Adds a soft rim glow opposite the primary light.
final
blur double
Backdrop blur applied behind the refraction pass. Liquid Glass is more transparent than older frosted glass — keep this low. The refraction does the heavy lifting.
final
chromaticAberration double
Strength of the RGB-channel split applied along the refraction vector. Mimics the chromatic dispersion at the edges of a real lens.
final
glassColor Color
Translucent colour wash baked into the glass. Use a very-low-alpha colour (default ≈ 14% white) — Liquid Glass is much more transparent than the older blur-only frosted glass look.
final
hashCode int
The hash code for this object.
no setteroverride
lightAngle double
Angle (in radians) of the virtual light source illuminating the droplet. Drives where the specular highlight curves across the rim.
final
lightIntensity double
Intensity of the primary specular highlight (0..1).
final
outerShadowOpacity double
Opacity of the soft outer shadow lifting the droplet off the background. Rendered by the wrapping widget, not the shader. Set to 0 to render flat.
final
refractiveIndex double
Optical refractive index. Water ≈ 1.33, common glass ≈ 1.50. Higher values bend light more sharply, exaggerating the droplet effect.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saturation double
Saturation multiplier applied to the refracted backdrop. Apple's Liquid Glass is mildly super-saturated.
final
thickness double
Thickness of the simulated glass in logical pixels. Thicker surfaces refract behind-content more strongly (bigger droplet).
final

Methods

adaptToBrightness(Brightness brightness) LiquidGlassConfig
Returns a config adapted to the supplied brightness. Dark mode flips the tint to a low-luminance variant, brightens the ambient rim, and beefs up the outer shadow per Apple's dark-mode Liquid Glass spec.
copyWith({double? thickness, double? blur, double? refractiveIndex, double? chromaticAberration, double? lightAngle, double? lightIntensity, double? ambientStrength, double? saturation, Color? glassColor, double? outerShadowOpacity}) LiquidGlassConfig
Returns a new config with the supplied fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toRendererSettings() → LiquidGlassSettings
Returns the underlying renderer settings derived from this config.
toString() String
A string representation of this object.
inherited

Operators

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