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
- Widget's own explicit
settingsparameter (highest priority) - Theme
GlassThemeSettings— only non-null fields applied - 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
Properties
- ambientStrength → double?
-
See LiquidGlassSettings.ambientStrength.
final
- blur → double?
-
See LiquidGlassSettings.blur.
final
- chromaticAberration → double?
-
See LiquidGlassSettings.chromaticAberration.
final
- glassColor → Color?
-
See LiquidGlassSettings.glassColor.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- lightAngle → double?
-
See LiquidGlassSettings.lightAngle.
final
- lightIntensity → double?
-
See LiquidGlassSettings.lightIntensity.
final
- refractiveIndex → double?
-
See LiquidGlassSettings.refractiveIndex.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- saturation → double?
-
See LiquidGlassSettings.saturation.
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? 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