GlassContentAwareScope constructor
const
GlassContentAwareScope({
- required Widget child,
- Duration sampleInterval = const Duration(milliseconds: 180),
- Duration flipDuration = const Duration(milliseconds: 200),
- Curve flipCurve = Curves.easeInOut,
- double lightToDarkThreshold = 0.6,
- double darkToLightThreshold = 0.6,
- Color? backgroundColor,
- bool sampleOnFrame = false,
- Key? key,
Creates a content-aware brightness scope.
Implementation
const GlassContentAwareScope({
required this.child,
this.sampleInterval = const Duration(milliseconds: 180),
this.flipDuration = const Duration(milliseconds: 200),
this.flipCurve = Curves.easeInOut,
this.lightToDarkThreshold = 0.6,
this.darkToLightThreshold = 0.6,
this.backgroundColor,
this.sampleOnFrame = false,
super.key,
}) : assert(
lightToDarkThreshold >= 0.5 && lightToDarkThreshold <= 1.0,
'lightToDarkThreshold must be within [0.5, 1.0]',
),
assert(
darkToLightThreshold >= 0.5 && darkToLightThreshold <= 1.0,
'darkToLightThreshold must be within [0.5, 1.0]',
);