GlassContentAwareScope constructor

const GlassContentAwareScope({
  1. required Widget child,
  2. Duration sampleInterval = const Duration(milliseconds: 180),
  3. Duration flipDuration = const Duration(milliseconds: 200),
  4. Curve flipCurve = Curves.easeInOut,
  5. double lightToDarkThreshold = 0.6,
  6. double darkToLightThreshold = 0.6,
  7. Color? backgroundColor,
  8. 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,
  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]',
      );