PatchbayCaptureBridge constructor

PatchbayCaptureBridge({
  1. required PatchbayGateEvaluator gates,
  2. required PatchbayUiRegistry registry,
  3. required PatchbayFrameObserver frames,
  4. required PatchbayArtifactService artifacts,
  5. Set<String> gateIds = const <String>{},
  6. PatchbayRootController? root,
  7. bool isAppResumed()?,
  8. PatchbayLifecycleStateReader? lifecycleState,
  9. PatchbayCaptureEncoder? encoder,
  10. PatchbayCaptureDecoder? decoder,
  11. int maxPixels = 16 * 1024 * 1024,
  12. int maxBytes = 8 * 1024 * 1024,
  13. double maxPixelRatio = 3,
  14. Duration defaultTimeout = const Duration(seconds: 5),
})

Implementation

PatchbayCaptureBridge({
  required this._gates,
  required this._registry,
  required this._frames,
  required this._artifacts,
  Set<String> gateIds = const <String>{},
  PatchbayRootController? root,
  bool Function()? isAppResumed,
  PatchbayLifecycleStateReader? lifecycleState,
  PatchbayCaptureEncoder? encoder,
  PatchbayCaptureDecoder? decoder,
  this.maxPixels = 16 * 1024 * 1024,
  this.maxBytes = 8 * 1024 * 1024,
  this.maxPixelRatio = 3,
  this.defaultTimeout = const Duration(seconds: 5),
}) : _gateIds = Set<String>.unmodifiable(gateIds),
     _root = root ?? PatchbayRootController.instance,
     _isAppResumed =
         isAppResumed ??
         (() =>
             WidgetsBinding.instance.lifecycleState ==
             AppLifecycleState.resumed),
     _lifecycleState = patchbayLifecycleReaderFor(
       isAppResumed: isAppResumed,
       lifecycleState: lifecycleState,
     ),
     _encoder = encoder ?? _encode,
     _decoder = decoder ?? _decode {
  if (maxPixels <= 0 ||
      maxBytes <= 0 ||
      maxPixelRatio <= 0 ||
      defaultTimeout <= Duration.zero) {
    throw ArgumentError('Capture limits must be positive.');
  }
}