GlassAdaptiveScope constructor

const GlassAdaptiveScope({
  1. required Widget child,
  2. GlassQuality minQuality = GlassQuality.minimal,
  3. GlassQuality maxQuality = GlassQuality.premium,
  4. GlassQuality? initialQuality,
  5. int targetFrameMs = 16,
  6. bool allowStepUp = true,
  7. double warmupPremiumThresholdMs = 20.0,
  8. double warmupStandardThresholdMs = 28.0,
  9. bool frostStep = false,
  10. double? minimalOpacity,
  11. void onQualityChanged(
    1. GlassQuality from,
    2. GlassQuality to
    )?,
  12. void onDiagnostic(
    1. GlassAdaptiveDiagnostic
    )?,
  13. bool debugLogDiagnostics = false,
  14. Key? key,
})

Creates a GlassAdaptiveScope.

child is required. All other parameters have sensible defaults.

Implementation

const GlassAdaptiveScope({
  required this.child,
  this.minQuality = GlassQuality.minimal,
  this.maxQuality = GlassQuality.premium,
  this.initialQuality,
  this.targetFrameMs = 16,
  this.allowStepUp = true,
  this.warmupPremiumThresholdMs = 20.0,
  this.warmupStandardThresholdMs = 28.0,
  this.frostStep = false,
  this.minimalOpacity,
  this.onQualityChanged,
  this.onDiagnostic,
  this.debugLogDiagnostics = false,
  super.key,
}) : assert(
        minimalOpacity == null ||
            (minimalOpacity >= 0.0 && minimalOpacity <= 1.0),
        'minimalOpacity must be between 0.0 and 1.0.',
      );