dormantSurface static method
settings with every visible contribution of the glass switched off,
while LiquidGlassSettings.visibility — and therefore the widget tree —
is left alone.
The sheet's own surface has to vanish while the droplet stands in for it,
yet its content has to stay visible inside the droplet. Neither of the
usual channels can do that: visibility fades the glass child along
with the glass on the premium path, and at exactly zero AdaptiveGlass
swaps to a different subtree, remounting every widget in the sheet. So
the surface is neutralised term by term instead — no tint, refraction,
blur, lighting, rim, shadow, veil or backer — leaving a pass that copies
its backdrop through unchanged.
Blur and frost are zeroed along with thickness so LiquidGlassRenderObject
takes its no-op fast-path and skips opening an offscreen BackdropFilter
pass; descendant glass controls inside the sheet then sample the droplet
and page backdrop directly during the morph.
Implementation
static LiquidGlassSettings dormantSurface(LiquidGlassSettings settings) {
final existingShadows = settings.effectiveShadow;
final existingBacker = settings.effectiveBackerColor;
return settings.copyWith(
glassColor: settings.glassColor.withValues(alpha: 0.0),
thickness: 0.0,
blur: 0.0,
frost: 0.0,
chromaticAberration: 0.0,
lightIntensity: 0.0,
ambientStrength: 0.0,
ambientRim: 0.0,
fresnelStrength: 0.0,
refractiveIndex: 1.0,
saturation: 1.0,
glowIntensity: 0.0,
shadow: existingShadows.isEmpty
? const <BoxShadow>[]
: const <BoxShadow>[BoxShadow(color: Color(0x00000000))],
whitenStrength: 0.0,
edgeAbsorption: 0.0,
rimShade: 0.0,
rimLight: 0.0,
bodyShade: 0.0,
backerColor: existingBacker != null && existingBacker.a > 0.0
? existingBacker.withValues(alpha: 1e-6)
: const Color(0x00000000),
);
}