GlassXConfig class
Defines the global visual configuration for the GlassXios system.
Pass an instance to GlassXMaterialApp via the config parameter,
or override it locally on any individual glass widget.
Example:
GlassXMaterialApp(
config: GlassXConfig.high(),
home: ...,
)
Constructors
- GlassXConfig({double blurStrength = 20.0, double opacity = 0.15, double borderRadius = 16.0, GlassXPerformance performanceMode = GlassXPerformance.balanced, bool enableVibrancy = false, Color tintColor = const Color(0x1AFFFFFF), Color borderColor = const Color(0x4DFFFFFF), double borderWidth = 1.0, bool debugMode = false})
-
const
- GlassXConfig.balanced()
-
Balanced preset (default). Good visual quality with moderate GPU cost.
factory
- GlassXConfig.high()
-
High-quality preset. Maximum blur fidelity, vibrancy enabled on iOS.
Suitable for flagship devices.
factory
- GlassXConfig.low()
-
Low-performance preset. Reduces blur quality for older or budget devices.
Blur: 8, opacity: 0.20, no vibrancy.
factory
Properties
- blurStrength → double
-
The blur radius applied to the glass surface.
Higher values increase the frosted-glass effect.
Range: 0–40. Default: 20.
final
- borderColor → Color
-
Border color drawn around the glass surface edge.
Default: white at 30% opacity.
final
- borderRadius → double
-
Corner radius of the glass surface in logical pixels.
Default: 16.
final
- borderWidth → double
-
Width of the border stroke in logical pixels.
Default: 1.0.
final
- debugMode → bool
-
Whether to show the debug performance overlay.
Useful during development to monitor GPU/CPU impact.
final
- enableVibrancy → bool
-
Whether to enable UIVibrancyEffect on iOS.
Vibrancy makes text/icons inside the view adapt to the blurred content.
Has no effect on Android or Web.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- opacity → double
-
Background fill opacity of the glass layer.
0.0 = fully transparent, 1.0 = fully opaque.
Default: 0.15.
final
- performanceMode → GlassXPerformance
-
Rendering performance target.
See GlassXPerformance for available modes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tintColor → Color
-
Tint color blended over the glass surface.
Typically a semi-transparent white or system colour.
Default: white at 10% opacity.
final
Methods
-
copyWith(
{double? blurStrength, double? opacity, double? borderRadius, GlassXPerformance? performanceMode, bool? enableVibrancy, Color? tintColor, Color? borderColor, double? borderWidth, bool? debugMode}) → GlassXConfig - Returns a copy of this config with the specified fields overridden.
-
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