PatchbayCaptureBridge constructor
PatchbayCaptureBridge({
- required PatchbayGateEvaluator gates,
- required PatchbayUiRegistry registry,
- required PatchbayFrameObserver frames,
- required PatchbayArtifactService artifacts,
- Set<
String> gateIds = const <String>{}, - PatchbayRootController? root,
- bool isAppResumed()?,
- PatchbayLifecycleStateReader? lifecycleState,
- PatchbayCaptureEncoder? encoder,
- PatchbayCaptureDecoder? decoder,
- int maxPixels = 16 * 1024 * 1024,
- int maxBytes = 8 * 1024 * 1024,
- double maxPixelRatio = 3,
- 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.');
}
}