GlassAdaptiveScopeConfig class
Bundles all GlassAdaptiveScope configuration into a single, portable value object.
Experimental — this API is available in 0.8.0 for community feedback. Phase 2 timing thresholds (12 ms / 20 ms P75) have been validated by reasoning but not yet by broad real-device data. If you observe unexpected quality degradation or promotion, please file an issue with your device model, raster timings (from Flutter DevTools), and the quality tier you expected vs received.
Use this when passing scope configuration through an API that cannot accept individual widget parameters directly — e.g. LiquidGlassWidgets.wrap:
runApp(LiquidGlassWidgets.wrap(
const MyApp(),
adaptiveQuality: true,
adaptiveConfig: GlassAdaptiveScopeConfig(
initialQuality: GlassQuality.standard, // earn your way up to premium
allowStepUp: true,
),
));
All fields mirror the corresponding parameters on GlassAdaptiveScope.
- Annotations
-
- @experimental
- @immutable
Constructors
- GlassAdaptiveScopeConfig({GlassQuality minQuality = GlassQuality.minimal, GlassQuality maxQuality = GlassQuality.premium, GlassQuality? initialQuality, int targetFrameMs = 16, bool allowStepUp = true, double warmupPremiumThresholdMs = 20.0, double warmupStandardThresholdMs = 28.0, void onQualityChanged(GlassQuality from, GlassQuality to)?, void onDiagnostic(GlassAdaptiveDiagnostic)?, bool debugLogDiagnostics = false})
-
Creates a GlassAdaptiveScopeConfig with sensible defaults.
const
Properties
- allowStepUp → bool
-
When
true, the scope may step quality up after a sustained period of good performance (e.g. after thermal recovery). Defaults totrue— allows Phase 3 to self-correct a conservative Phase 2 warmup decision. Step-up requires 10 consecutive under-budget windows (≈ 20 seconds) plus an 8-second cooldown, so the transition is invisible.final - debugLogDiagnostics → bool
-
When
true, prints a structured diagnostic log to the console on every quality change — debug builds only (no-op in release/profile).final - hashCode → int
-
The hash code for this object.
no setteroverride
- initialQuality → GlassQuality?
-
The quality to display before the warm-up benchmark completes.
When null (the default), maxQuality is used.
final
- maxQuality → GlassQuality
-
The highest quality tier the scope may use.
Defaults to GlassQuality.premium.
final
- minQuality → GlassQuality
-
The lowest quality tier the scope will ever enforce.
Defaults to GlassQuality.minimal.
final
- onDiagnostic → void Function(GlassAdaptiveDiagnostic)?
-
Called with rich diagnostic data whenever the effective quality changes.
final
- onQualityChanged → void Function(GlassQuality from, GlassQuality to)?
-
Called whenever the effective quality tier changes.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targetFrameMs → int
-
The raster frame duration target in milliseconds. Defaults to
16(60 fps).final - warmupPremiumThresholdMs → double
-
The P75 warmup threshold (ms) below which the device is classified as
capable of GlassQuality.premium. Defaults to
20.0.final - warmupStandardThresholdMs → double
-
The P75 warmup threshold (ms) at or below which the device is classified
as capable of GlassQuality.standard (when above warmupPremiumThresholdMs).
Defaults to
28.0.final
Methods
-
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.
override