GlassThemeSettings class

A partial override of LiquidGlassSettings for use in GlassThemeVariant.

Unlike LiquidGlassSettings, every field here is optional (null). A null value means "do not override — use the widget's own default".

This solves the footgun where setting a single property like thickness in the theme would silently zero out all other settings (e.g. glassColor would revert to fully transparent because the constructor default is Color.fromARGB(0, …)).

Usage

GlassTheme(
  data: GlassThemeData(
    light: GlassThemeVariant(
      // Only thickness and blur are overridden — glassColor, refractiveIndex,
      // lightIntensity, etc. continue to use each widget's own defaults.
      settings: GlassThemeSettings(
        thickness: 40,
        blur: 6,
      ),
    ),
  ),
  child: …,
)

Merge order

  1. Widget's own explicit settings parameter (highest priority)
  2. Theme GlassThemeSettings — only non-null fields applied
  3. Widget's built-in per-widget defaults (lowest priority)
Annotations

Constructors

GlassThemeSettings({double? visibility, Color? glassColor, double? thickness, double? blur, double? chromaticAberration, double? lightAngle, double? lightIntensity, double? ambientStrength, double? refractiveIndex, double? saturation, GlassSpecularSharpness? specularSharpness})
Creates a partial settings override.
const

Methods

applyTo(LiquidGlassSettings base) LiquidGlassSettings
Returns a new LiquidGlassSettings by applying this override onto base.
copyWith({double? visibility, Color? glassColor, double? thickness, double? blur, double? chromaticAberration, double? lightAngle, double? lightIntensity, double? ambientStrength, double? refractiveIndex, double? saturation, GlassSpecularSharpness? specularSharpness}) GlassThemeSettings
Creates a copy with overridden values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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