enableBackgroundSampling property

bool? enableBackgroundSampling
final

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:

This flag is ignored when the ambient GlassAdaptiveScope has degraded to GlassQuality.minimal — sampling is always disabled in that tier.

Implementation

final bool? enableBackgroundSampling;