flight_recorder library

Backward compatibility export.

Classes

CrashFlightEvent
Unhandled crash or intercepted exception.
CryptoEngine
Encryption / decryption engine for .flightlog and .eflightlog files.
CustomBreadcrumbFlightEvent
Custom breadcrumb or state transition event.
EventRingBuffer<T>
A high-performance, fixed-capacity circular ring buffer.
FlightConfig
Configuration options for Flight Recorder.
FlightErrorInterceptor
Intercepts framework-level Flutter errors and root platform dispatch errors.
FlightEvent
Base class for all events captured by Flight Recorder.
FlightLifecycleObserver
Listens to app lifecycle states and window metric changes.
FlightPointerInjector
Helper utility for feeding recorded pointer events into Flutter's WidgetTester.
FlightRecorder
The central coordinator managing active session recording, ring buffer, interceptors, and automated crash dump generation.
FlightRecorderHttpOverrides
Global HTTP overrides that captures all dart:io HttpClient traffic.
FlightRecorderNavigatorObserver
A NavigatorObserver that records route transitions into Flight Recorder.
FlightRecorderOverlay
A floating diagnostic widget providing one-tap access to flight logs, session export, and instant testWidgets code generation in staging/dogfood builds.
FlightRecorderWebSocketInterceptor
Installs a global HttpOverrides that wraps every new WebSocket connection with a recording proxy.
FlightReplayServer
A deterministic HTTP replay server used during widget tests. Matches requests against recorded session fixtures and returns responses.
FlightSerializer
Serializes and deserializes FlightSession data to and from files or bytes.
FlightSession
Complete captured flight session holding metadata and recorded events.
FlightSynthesizer
Generates valid, executable Dart testWidgets code from a FlightSession.
FlightWebSocketReplayServer
Installs fake WebSocket connections that replay pre-recorded messages.
HttpFlightEvent
Network requests and responses captured by HttpOverrides or Dio.
LifecycleFlightEvent
App lifecycle and viewport changes.
Route transitions (screen push, pop, replace).
PlatformChannelFlightEvent
A MethodChannel or EventChannel call captured at the BinaryMessenger level. Binary payloads are base64-encoded and truncated to 16 KB so that large binary blobs (images, fonts) do not bloat the flight recording.
PlatformChannelInterceptor
Attaches to ServicesBinding.defaultBinaryMessenger and records every outgoing MethodChannel call and every incoming response.
PlatformChannelRawEvent
A single recorded platform-channel interaction.
PlatformChannelReplayBinding
Utilities for replaying recorded PlatformChannelFlightEvents in a test environment.
PointerFlightEvent
Pointer interaction (taps, drags, flings, scrolls).
PointerInterceptor
Intercepts all global pointer events at the Flutter engine level. Uses GestureBinding.instance.pointerRouter without requiring wrapping widgets.
RedactionEngine
The engine that redacts sensitive information from headers, URLs, and JSON payloads.
RedactRule
A rule for sanitizing sensitive data before storage.
ReplayFixture
RouteStackSnapshotEvent
A snapshot of the full navigation route stack captured at session start (or whenever a recording resumes mid-session). The synthesizer uses this to emit the correct sequence of Navigator.pushNamed calls so that the replayed test starts on the right screen even for deeply-nested routes.
SecureFlightSerializer
Serialises / deserialises FlightSession objects to / from encrypted .eflightlog files.
SemanticPointerFlightEvent
Pointer event enriched with semantic widget-identity information resolved at record time via a hit-test so that the test synthesizer can generate robust widget-finder expressions (by key, type, text, tooltip, or semantic label) instead of relying solely on raw coordinates.
SemanticResolver
A production-grade hit-test resolver that, given an Offset on screen, walks the Flutter render/element tree to find the best-matching widget identity (Key, Type, Text, Tooltip, Semantic label).
SessionManifest
Metadata about the recorded session environment.
TestHarnessBuilder
Generates Flutter integration-test harness source files that replay recorded HTTP traffic and platform-channel calls captured by flight_recorder.
TextInputFlightEvent
Keyboard / IME event captured by intercepting the flutter/textinput platform channel. PII is redacted before the event is stored; raw text is never persisted.
TextInputInterceptor
Intercepts keyboard / IME events by wrapping the ServicesBinding.defaultBinaryMessenger with a custom BinaryMessenger that observes messages on the flutter/textinput platform channel.
WebSocketFlightEvent
A WebSocket lifecycle or message event captured by wrapping the WebSocket client used by the application.
WebSocketRawEvent
A single recorded WebSocket interaction.
WebSocketReplayFixture
Describes a set of server-side messages to replay for a given URL pattern.
WidgetIdentity
Metadata describing the identity of a widget found via a hit-test.

Enums

DiFramework
The DI framework in use in the host application.
PlatformChannelDirection
Direction of a platform-channel message.
WebSocketEventKind
The type of a WebSocketFlightEvent.

Functions

recordedWebSocketConnect(String url, FlightRecorderWebSocketInterceptor interceptor, {Iterable<String>? protocols, Map<String, dynamic>? headers, CompressionOptions compression = CompressionOptions.compressionDefault, HttpClient? customClient}) → Future<WebSocket>
A drop-in replacement for WebSocket.connect that wraps the resulting socket with a _RecordingWebSocket bound to interceptor.

Typedefs

FlightFixture = ReplayFixture
Compatibility alias for ReplayFixture.
OnCrashFlightEvent = void Function(CrashFlightEvent event)
OnHttpFlightEvent = void Function(HttpFlightEvent event)
OnLifecycleFlightEvent = void Function(LifecycleFlightEvent event)
OnNavigationFlightEvent = void Function(NavigationFlightEvent event)
OnPlatformChannelEvent = void Function(PlatformChannelRawEvent event)
Callback type for platform-channel events.
OnPointerFlightEvent = void Function(PointerFlightEvent event)
OnTextInputFlightEvent = void Function(TextInputFlightEvent event)
Callback invoked whenever a TextInputFlightEvent is captured.
OnWebSocketFlightEvent = void Function(WebSocketRawEvent event)
Callback type for WebSocket flight events.
PlatformErrorCallback = bool Function(Object exception, StackTrace stackTrace)
RedactFunction = String Function(String input)

Exceptions / Errors

CryptoAuthException
Thrown when HMAC-SHA256 authentication fails during decryption.
EFlightFormatException
Thrown when a file does not begin with the expected EFLIGHT magic bytes.