LDObserve class final
Static facade for LaunchDarkly observability and session replay from
Flutter. Mirrors the C# LaunchDarkly.Observability.LDObserve facade and is
the single public entry point for both initialization and recording.
Fully usable on web and mobile: it only depends on cross-platform code (the platform abstraction and the Dart OpenTelemetry pipeline), never on the native bridge directly.
Dart does not support method overloading, so the two init variants are split
into LDObserve.init (LaunchDarkly client backed) and
LDObserve.initStandalone (standalone, no client) — matching the two
Init(client, ...) / Init(mobileKey, ...) overloads in MAUI.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- nativeVersion → String
-
The native observability bridge version reported during startup, or an
empty string before initialization (or on web, which has no native
bridge).
no setter
Static Methods
-
init(
LDClient client, {required ObservabilityOptions observability, SessionReplayOptions? replay}) → Future< bool> -
Boots observability (and optional session replay) by registering the
internal plugin on an already-constructed
LDClient. MirrorsLDObserve.Init(LdClient client, ...). -
initStandalone(
String mobileKey, {required ObservabilityOptions observability, SessionReplayOptions? replay}) → Future< bool> -
Boots observability (and optional session replay) standalone, without a
LaunchDarkly client. Mirrors
LDObserve.Init(string mobileKey, ...). -
recordException(
dynamic exception, {StackTrace? stackTrace, Map< String, Object?> ? properties}) → void -
Record an exception with an optional stack trace and
properties. -
recordLog(
String message, {LogSeverity severity = LogSeverity.info, StackTrace? stackTrace, Map< String, Object?> ? properties}) → void -
Record a log with optional
properties. Defaultsseverityto LogSeverity.info. -
shutdown(
) → Future< void> - Shut down observability and session replay for the rest of the process.
-
startSpan(
String name, {SpanKind kind = SpanKind.internal, Map< String, Object?> ? properties}) → Span -
Start a span with the given name and optional
properties. -
track(
String eventName, {Map< String, Object?> ? properties, num? metricValue}) → void -
Record a custom
trackevent as atrackspan. -
trackClick(
{String? id, String? tag, String? text, double? x, double? y, Map< String, Object?> ? properties}) → void -
Record a click so it appears on the Session Replay timeline as a
Clickevent and as aclickspan. -
trackScreenView(
String name, {String? screenClass, String? screenId, String? category, Map< String, Object?> ? properties}) → void -
Record a screen view (navigation) so it appears on the Session Replay
timeline as a
Navigateevent and as ascreen_viewspan. -
withSpan<
T> (String name, T fn(Span span), {SpanKind kind = SpanKind.internal, Map< String, Object?> ? properties}) → T -
Run
fninside a new span that ends automatically. -
zoneSpecification(
) → ZoneSpecification - Get a zone specification which intercepts print statements.