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? frost, double? frostOpacity, double? frostClamp, double? frostWeight, double? blurWeight, double? chromaticAberration, double? lightAngle, double? lightIntensity, double? ambientStrength, double? fresnelStrength, double? refractiveIndex, double? saturation, GlassSpecularSharpness? specularSharpness, double? edgeAbsorption, double? rimShade, double? rimShadeEnds, double? rimLight, double? bodyShade, GlassLensModel? lensModel, double? shadowElevation, List<BoxShadow>? shadow})
Creates a partial settings override.
const

Properties

ambientStrength → double?
See LiquidGlassSettings.ambientStrength.
final
blur → double?
See LiquidGlassSettings.blur.
final
blurWeight → double?
See LiquidGlassSettings.blurWeight.
final
bodyShade → double?
See LiquidGlassSettings.bodyShade.
final
chromaticAberration → double?
See LiquidGlassSettings.chromaticAberration.
final
edgeAbsorption → double?
See LiquidGlassSettings.edgeAbsorption.
final
fresnelStrength → double?
See LiquidGlassSettings.fresnelStrength.
final
frost → double?
See LiquidGlassSettings.frost.
final
frostClamp → double?
See LiquidGlassSettings.frostClamp.
final
frostOpacity → double?
See LiquidGlassSettings.frostOpacity.
final
frostWeight → double?
See LiquidGlassSettings.frostWeight.
final
glassColor → Color?
See LiquidGlassSettings.glassColor.
final
hashCode → int
The hash code for this object.
no setteroverride
lensModel → GlassLensModel?
See LiquidGlassSettings.lensModel.
final
lightAngle → double?
See LiquidGlassSettings.lightAngle.
final
lightIntensity → double?
See LiquidGlassSettings.lightIntensity.
final
refractiveIndex → double?
See LiquidGlassSettings.refractiveIndex.
final
rimLight → double?
See LiquidGlassSettings.rimLight.
final
rimShade → double?
See LiquidGlassSettings.rimShade.
final
rimShadeEnds → double?
See LiquidGlassSettings.rimShadeEnds.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
saturation → double?
See LiquidGlassSettings.saturation.
final
shadow → List<BoxShadow>?
See LiquidGlassSettings.shadow.
final
shadowElevation → double?
See LiquidGlassSettings.shadowElevation.
final
specularSharpness → GlassSpecularSharpness?
See LiquidGlassSettings.specularSharpness.
final
thickness → double?
See LiquidGlassSettings.thickness.
final
visibility → double?
See LiquidGlassSettings.visibility.
final

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? frost, double? frostOpacity, double? frostClamp, double? frostWeight, double? blurWeight, double? chromaticAberration, double? lightAngle, double? lightIntensity, double? ambientStrength, double? fresnelStrength, double? refractiveIndex, double? saturation, GlassSpecularSharpness? specularSharpness, double? edgeAbsorption, double? rimShade, double? rimShadeEnds, double? rimLight, double? bodyShade, GlassLensModel? lensModel, double? shadowElevation, List<BoxShadow>? shadow}) → 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

Static Methods

lerp(GlassThemeSettings? a, GlassThemeSettings? b, double t) → GlassThemeSettings?
Linearly interpolates between two partial overrides.

Constants

ios27Dark → const GlassThemeSettings
iOS 27 glassEffect(.regular) in the dark appearance, matching LiquidGlassSettings.ios27Dark.
ios27Light → const GlassThemeSettings
iOS 27 glassEffect(.regular) in the light appearance, matching LiquidGlassSettings.ios27Light.