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 chromaticAberration = .01, double lightAngle = GlassDefaults.lightAngle, double lightIntensity = .5, double ambientStrength = 0, double refractiveIndex = 1.2, double saturation = 1.5, GlassSpecularSharpness specularSharpness = GlassSpecularSharpness.medium})
-
Creates a new LiquidGlassSettings with the given settings.
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})
- Creates LiquidGlassSettings using Figma-inspired parameter names.
Properties
- ambientStrength → double
-
The strength of the ambient light.
final
- blur → double
-
The blur of the glass effect.
final
- chromaticAberration → double
-
The chromatic aberration of the glass effect (WIP).
final
- effectiveAmbientStrength → double
-
The effective ambient strength taking visibility into account.
no setter
- effectiveBlur → double
-
The effective blur taking visibility into account.
no setter
- effectiveChromaticAberration → double
-
The effective chromatic aberration 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
- effectiveSaturation → double
-
The effective saturation taking visibility into account.
no setter
- effectiveThickness → double
-
The effective thickness taking visibility into account.
no setter
- glassColor → Color
-
The color tint of the glass effect.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lightAngle → double
-
The angle of the light source in radians.
final
- lightIntensity → double
-
The intensity of the light source.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- refractiveIndex → double
-
The strength of the refraction.
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
- specularSharpness → GlassSpecularSharpness
-
The sharpness of the specular highlight on the glass rim.
final
- stringify → bool?
-
If set to
true, the toString method will be overridden to output this instance's props.no setterinherited - thickness → double
-
The thickness of the glass surface.
final
- visibility → double
-
A factor that can be used to scale all thickness-related properties.
final
Methods
-
copyWith(
{double? visibility, Color? glassColor, double? thickness, double? blur, double? chromaticAberration, double? blend, double? lightAngle, double? lightIntensity, double? ambientStrength, double? refractiveIndex, double? saturation, GlassSpecularSharpness? specularSharpness}) → LiquidGlassSettings - Creates a new LiquidGlassSettings with the given settings.
-
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.
inherited
Static Methods
-
of(
BuildContext context) → LiquidGlassSettings - Retrieves the nearest LiquidGlassSettings from the widget tree.