LiquidGlassSettings class

Represents the settings for a liquid glass effect.

Constructors

LiquidGlassSettings({double visibility = 1.0, Color glassColor = const Color.fromARGB(0, 255, 255, 255), double thickness = 20, double blur = 5, double frost = 0.0, double frostOpacity = 1.0, double frostClamp = 0.0, double frostWeight = 1.0, double blurWeight = 1.0, double chromaticAberration = .01, double lightAngle = GlassDefaults.lightAngle, double lightIntensity = .5, double ambientStrength = 0, double ambientRim = 0, double fresnelStrength = 1.0, double refractiveIndex = 1.2, double saturation = 1.5, double glowIntensity = 0.75, GlassSpecularSharpness specularSharpness = GlassSpecularSharpness.medium, double standardOpacityMultiplier = 1.0, double shadowElevation = 1.0, List<BoxShadow>? shadow, double whitenStrength = 0.0, bool whitenGated = true, double edgeAbsorption = 0.0, double rimShade = 0.0, double rimShadeEnds = 0.2, double rimLight = 0.0, double bodyShade = 0.0, GlassLensModel lensModel = GlassLensModel.spherical, Color? backerColor, Color? platformViewFallbackColor, PlatformViewGlassMode platformViewMode = PlatformViewGlassMode.fallbackColor, GlassBodyMode bodyMode = GlassBodyMode.adaptive})
Creates a new LiquidGlassSettings with the given settings. Public constructor — all material glass properties.
const
LiquidGlassSettings.figma({required double refraction, required double depth, required double dispersion, required double frost, double visibility = 1.0, double lightIntensity = 50, double lightAngle = GlassDefaults.lightAngle, Color glassColor = const Color.fromARGB(0, 255, 255, 255), GlassSpecularSharpness specularSharpness = GlassSpecularSharpness.medium, double standardOpacityMultiplier = 1.0})
Creates LiquidGlassSettings using Figma-inspired parameter names.
const

Properties

ambientRim → double
Full-perimeter rim ("ring") boost, 0 to ~1.
final
ambientStrength → double
The strength of the ambient light.
final
backerColor → Color?
Optional dimming "backer" painted directly behind the glass.
final
blur → double
The blur (frost) radius of the glass effect.
final
blurWeight → double
How many times a white pixel outweighs a black one in the copy of the content that shows through a frost, as frostWeight is for the cloud; 1 (the default) is a plain blur.
final
bodyMode → GlassBodyMode
How the glass body blends color over the background.
final
bodyShade → double
How far a bright backdrop is pulled down under the glass, 0 to 1.
final
chromaticAberration → double
The chromatic aberration of the glass effect (WIP).
final
edgeAbsorption → double
Meniscus darkening strength at the glass rim, from 0 to 1.
final
effectiveAmbientRim → double
The effective ambient rim taking visibility into account.
no setter
effectiveAmbientStrength → double
The effective ambient strength taking visibility into account.
no setter
effectiveBackerColor → Color?
The effective backer taking visibility into account.
no setter
effectiveBlur → double
The effective blur taking visibility into account.
no setter
effectiveBodyShade → double
The effective body shade taking visibility into account.
no setter
effectiveChromaticAberration → double
The effective chromatic aberration taking visibility into account.
no setter
effectiveEdgeAbsorption → double
The effective meniscus darkening taking visibility into account.
no setter
effectiveFresnelStrength → double
The effective Fresnel strength taking visibility into account.
no setter
effectiveFrost → double
The effective frost taking visibility into account.
no setter
effectiveGlassColor → Color
The effective glass color taking visibility into account.
no setter
effectiveLightIntensity → double
The effective light intensity taking visibility into account.
no setter
effectiveRefractiveIndex → double
The effective refractive index taking visibility into account.
no setter
effectiveRimLight → double
The effective rim light taking visibility into account.
no setter
effectiveRimShade → double
The effective rim shade taking visibility into account.
no setter
effectiveSaturation → double
The effective saturation taking visibility into account.
no setter
effectiveShadow → List<BoxShadow>
Returns the effective shadow list for light-mode rendering.
no setter
effectiveShadowElevation → double
The effective elevation taking visibility into account.
no setter
effectiveThickness → double
The effective thickness taking visibility into account.
no setter
effectiveWhitenStrength → double
The effective whitening taking visibility into account.
no setter
fresnelStrength → double
Scales the natural Fresnel edge luminosity on the Premium (Impeller) path.
final
frost → double
Heavy blur of the backdrop, as a Gaussian sigma in logical pixels, composited at frostOpacity. Defaults to 0, off.
final
frostClamp → double
How far the copy of the content showing through the frost may stray from the cloud on one side, as a fraction of full scale before frostOpacity is applied; 0 (the default) leaves both sides free.
final
frostOpacity → double
Opacity of the frost over the backdrop beneath it, from 0 to 1.
final
frostWeight → double
How many times a white pixel outweighs a black one in the frost's average; 1 (the default) is a plain mean.
final
glassColor → Color
The color tint of the glass effect.
final
glowIntensity → double
The intensity of the fresnel edge glow on the glass rim.
final
hashCode → int
The hash code for this object.
no setteroverride
lensModel → GlassLensModel
How the bevel bends the backdrop. See GlassLensModel.
final
lightAngle → double
The angle of the light source in radians.
final
lightIntensity → double
The intensity of the light source.
final
pinchStrength → double
Internal shader transport — the animated pinch strength for the concave lens effect on indicator pills.
final
platformViewFallbackColor → Color?
Solid stand-in color the lens composites where the engine can't capture the backdrop — i.e. behind a PlatformView past the glass, which the lens would otherwise render black (see platformViewBackdrop on the glass widgets).
final
platformViewMode → PlatformViewGlassMode
How the body resolves where the backdrop had nothing to sample.
final
refractiveIndex → double
The strength of the refraction.
final
rimLight → double
Strength of the iOS 27 rim highlight.
final
rimShade → double
Strength of the hairline outline on the very edge of the glass, 0 to 1.
final
rimShadeEnds → double
How much of rimShade survives at the ends of the light axis, where the rimLight lobes sit, as a fraction of its strength across it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saturation → double
The saturation adjustment for pixels that shine through the glass.
final
shadow → List<BoxShadow>?
Custom light-mode drop shadow for glass surfaces.
final
shadowElevation → double
Scales the built-in light-mode drop shadow on glass surfaces.
final
specularSharpness → GlassSpecularSharpness
The sharpness of the specular highlight on the glass rim.
final
standardOpacityMultiplier → double
A multiplier applied to the alpha channel of glassColor when rendering in Standard mode. This allows tuning the Standard 2D compositing opacity to achieve parity with the Premium 3D volumetric refraction, without needing separate color values for each mode.
final
thickness → double
The thickness of the glass surface.
final
visibility → double
A factor that can be used to scale all thickness-related properties.
final
whitenGated → bool
Whether whitenStrength is luminance-gated (true, the default) or applied uniformly (false).
final
whitenStrength → double
Light-mode whitening ("legibility veil") amount, from 0 to 1.
final

Methods

copyWith({double? visibility, Color? glassColor, double? thickness, double? blur, double? frost, double? frostOpacity, double? frostClamp, double? frostWeight, double? blurWeight, double? chromaticAberration, double? blend, double? lightAngle, double? lightIntensity, double? ambientStrength, double? ambientRim, double? fresnelStrength, double? refractiveIndex, double? saturation, double? glowIntensity, GlassSpecularSharpness? specularSharpness, double? standardOpacityMultiplier, double? shadowElevation, List<BoxShadow>? shadow, double? whitenStrength, bool? whitenGated, double? edgeAbsorption, double? rimShade, double? rimShadeEnds, double? rimLight, double? bodyShade, GlassLensModel? lensModel, Color? backerColor, Color? platformViewFallbackColor, PlatformViewGlassMode? platformViewMode, GlassBodyMode? bodyMode}) → LiquidGlassSettings
Creates a new LiquidGlassSettings with the given settings.
copyWithPinch(double value) → LiquidGlassSettings
Returns a copy of these settings with pinchStrength set to value.
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.
override

Static Methods

lerp(LiquidGlassSettings? a, LiquidGlassSettings? b, double t) → LiquidGlassSettings
Linearly interpolates between two LiquidGlassSettings.
lerpDouble(num? a, num? b, double t) → double?
Helper for linear interpolation of doubles.
of(BuildContext context) → LiquidGlassSettings
Retrieves the nearest LiquidGlassSettings from the widget tree.

Constants

ios27Dark → const LiquidGlassSettings
iOS 27 glassEffect(.regular) in the dark appearance; see ios27Light.
ios27Light → const LiquidGlassSettings
iOS 27 glassEffect(.regular) in the light appearance.