snapshot method

CockpitSnapshot snapshot({
  1. CockpitSnapshotOptions options = const CockpitSnapshotOptions(),
})

Implementation

CockpitSnapshot snapshot({
  CockpitSnapshotOptions options = const CockpitSnapshotOptions(),
}) {
  final surfaceState = _requireSurfaceState();
  final snapshot = surfaceState.snapshot(options: options);
  final networkObserver = FlutterCockpit.binding.networkObserver;
  final runtimeObserver = FlutterCockpit.binding.runtimeObserver;
  return snapshot.copyWith(
    network: !options.includeNetworkActivity || networkObserver == null
        ? snapshot.network
        : networkObserver.snapshot(
            maxEntries: options.maxNetworkEntries,
            query: options.networkQuery,
          ),
    runtime: !options.includeRuntimeActivity || runtimeObserver == null
        ? snapshot.runtime
        : runtimeObserver.snapshot(
            maxEntries: options.maxRuntimeEntries,
            query: options.runtimeQuery,
          ),
  );
}