enableBackgroundSampling property
Whether to capture the background as a GPU texture for glass colour absorption.
Defaults to true if background is provided, and false otherwise.
Set to false explicitly if you have a background but do not want the
performance cost of sampling it (glass will use synthetic frost).
When false:
- No RepaintBoundary is inserted around the background.
- No Ticker runs — cost is effectively zero beyond one GlobalKey allocation.
- Glass widgets still render correctly with the synthetic frost look.
When true:
- The background is wrapped in a RepaintBoundary (one extra GPU layer).
- A Ticker in GlassEffect fires when GlassEffect.interactionIntensity
exceeds 0.01 and the widget's
bluris greater than 0.
This flag is ignored when the ambient GlassAdaptiveScope has degraded to GlassQuality.minimal — sampling is always disabled in that tier.
Implementation
final bool? enableBackgroundSampling;