posthog_flutter library

Public Flutter API for the PostHog SDK.

Classes

Posthog
Entry point for the PostHog Flutter SDK.
PostHogBootstrapConfig
Pre-seeded identity and feature-flag state applied on the very first SDK launch, before any network request completes.
PostHogConfig
Configuration used to initialize the PostHog Flutter SDK.
PostHogErrorTrackingConfig
Configuration for PostHog error tracking and exception capture.
PostHogEvent
Represents an event that can be modified or dropped before it is sent.
PostHogExceptionStepsConfig
Configuration for exception steps.
PostHogFeatureFlagResult
Represents the result of a feature flag evaluation.
PostHogLogger
Per-level convenience facade for capturing structured logs.
PostHogLogRecord
Represents a log record that can be modified or dropped before it is sent.
PostHogLogsConfig
Configuration for the logs subsystem.
PostHogMaskWidget
Masks a widget subtree in PostHog session replay snapshots.
PostHogMaskWidgetState
State for PostHogMaskWidget.
PosthogObserver
A Flutter NavigatorObserver that automatically captures $screen events.
PostHogPlatformView
Session replay policy marker for an embedded platform view.
PostHogRageClickConfig
Configuration for rage-click autocapture on iOS and Mac Catalyst.
PostHogSessionReplayConfig
Configuration for mobile session replay capture and masking.
PostHogTextMask
What session replay masks inside one text node.
PostHogTextMaskAll
PostHogTextMask.all: the whole node is masked.
PostHogTextMaskExcept
PostHogTextMask.except: everything but ranges is masked.
PostHogTextMaskNone
PostHogTextMask.none: the whole node stays visible.
PostHogTextMaskOnly
PostHogTextMask.only: only ranges are masked.
PostHogTextMaskPolicies
Ready-made PostHogTextMaskPolicy implementations.
PostHogUnmaskWidget
Reveals a widget subtree in session replay despite global text/image masking.
PostHogWidget
Wraps a Flutter app to enable mobile session replay screenshots.
PostHogWidgetState
State for PostHogWidget.

Enums

PostHogDataMode
Controls which network connection types can be used for sending data.
PostHogLogSeverity
Severity level for a structured log record captured via Posthog().captureLog() or the Posthog().logger facade.
PostHogPersonProfiles
Controls whether events create or update PostHog person profiles.
PostHogPlatformViewPrivacy
Controls how a platform view is handled in session replay.
PostHogScreenshotColorMode
Pixel format for Android native-screen captures in session replay.

Functions

defaultNameExtractor(RouteSettings settings) String?
Returns RouteSettings.name as the screen name for settings.
defaultPostHogRouteFilter(Route? route) bool
Returns whether route should be tracked by the default route filter.

Typedefs

BeforeSendCallback = FutureOr<PostHogEvent?> Function(PostHogEvent event)
Callback to intercept and modify events before they are sent to PostHog.
BeforeSendLogCallback = FutureOr<PostHogLogRecord?> Function(PostHogLogRecord record)
Callback to intercept and modify log records before they are sent to PostHog.
PostHogRouteFilter = bool Function(Route? route)
Filters routes before PosthogObserver captures screen views.
PostHogTextMaskPolicy = PostHogTextMask Function(String text, Widget widget)
Decides what to mask in a text node, given its rendered string and the widget that produced it.
PushIdentityProvider = Future<String?> Function(String distinctId, String appId)
Mints a signed identity-verification token for a push subscription request.
ScreenNameExtractor = String? Function(RouteSettings settings)
Extracts a PostHog screen name from Flutter RouteSettings.