LiquidGlassSettings constructor

const LiquidGlassSettings({
  1. double visibility = 1.0,
  2. Color glassColor = const Color.fromARGB(0, 255, 255, 255),
  3. double thickness = 20,
  4. double blur = 5,
  5. double frost = 0.0,
  6. double frostOpacity = 1.0,
  7. double frostClamp = 0.0,
  8. double frostWeight = 1.0,
  9. double blurWeight = 1.0,
  10. double chromaticAberration = .01,
  11. double lightAngle = GlassDefaults.lightAngle,
  12. double lightIntensity = .5,
  13. double ambientStrength = 0,
  14. double ambientRim = 0,
  15. double fresnelStrength = 1.0,
  16. double refractiveIndex = 1.2,
  17. double saturation = 1.5,
  18. double glowIntensity = 0.75,
  19. GlassSpecularSharpness specularSharpness = GlassSpecularSharpness.medium,
  20. double standardOpacityMultiplier = 1.0,
  21. double shadowElevation = 1.0,
  22. List<BoxShadow>? shadow,
  23. double whitenStrength = 0.0,
  24. bool whitenGated = true,
  25. double edgeAbsorption = 0.0,
  26. double rimShade = 0.0,
  27. double rimShadeEnds = 0.2,
  28. double rimLight = 0.0,
  29. double bodyShade = 0.0,
  30. GlassLensModel lensModel = GlassLensModel.spherical,
  31. Color? backerColor,
  32. Color? platformViewFallbackColor,
  33. PlatformViewGlassMode platformViewMode = PlatformViewGlassMode.fallbackColor,
  34. GlassBodyMode bodyMode = GlassBodyMode.adaptive,
})

Creates a new LiquidGlassSettings with the given settings. Public constructor — all material glass properties.

pinchStrength is intentionally absent here. It is an internal shader-transport value set only by AnimatedGlassIndicator via copyWithPinch. Users configure the effect through the hosting widget's indicatorPinchStrength parameter instead.

Implementation

const LiquidGlassSettings({
  this.visibility = 1.0,
  this.glassColor = const Color.fromARGB(0, 255, 255, 255),
  this.thickness = 20,
  this.blur = 5,
  this.frost = 0.0,
  this.frostOpacity = 1.0,
  this.frostClamp = 0.0,
  this.frostWeight = 1.0,
  this.blurWeight = 1.0,
  this.chromaticAberration = .01,
  this.lightAngle = GlassDefaults.lightAngle,
  this.lightIntensity = .5,
  this.ambientStrength = 0,
  this.ambientRim = 0,
  this.fresnelStrength = 1.0,
  this.refractiveIndex = 1.2,
  this.saturation = 1.5,
  this.glowIntensity = 0.75,
  this.specularSharpness = GlassSpecularSharpness.medium,
  this.standardOpacityMultiplier = 1.0,
  this.shadowElevation = 1.0,
  this.shadow,
  this.whitenStrength = 0.0,
  this.whitenGated = true,
  this.edgeAbsorption = 0.0,
  this.rimShade = 0.0,
  this.rimShadeEnds = 0.2,
  this.rimLight = 0.0,
  this.bodyShade = 0.0,
  this.lensModel = GlassLensModel.spherical,
  this.backerColor,
  this.platformViewFallbackColor,
  this.platformViewMode = PlatformViewGlassMode.fallbackColor,
  this.bodyMode = GlassBodyMode.adaptive,
}) : pinchStrength = 0.0;