RetainPixelClient class
RetainPixel Flutter SDK client.
Usage:
final rp = RetainPixelClient(RetainPixelConfig(
orgId: 'your-org-uuid',
appId: 'your-app-uuid',
apiKey: 'rpx_live_...',
));
await rp.init();
rp.track('video_uploaded', properties: {'duration': 30});
Constructors
- RetainPixelClient(RetainPixelConfig config, {Client? httpClient})
Properties
- config → RetainPixelConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Clean up resources. Call on app dispose.
-
experimentExposure(
String experimentId, String armId) → void - Track an experiment exposure.
-
flush(
) → Future< void> - Flush all queued events to the ingest endpoint.
-
identify(
String userId, {Map< String, dynamic> properties = const {}}) → void - Identify the user with a pseudonymous hash. Do NOT pass raw user IDs or PII — hash on the client side first, or pass a pre-hashed identifier.
-
init(
) → Future< void> - Initialize the SDK. Must be called before tracking events. Restores or creates anonymous ID and session, and loads any buffered events from a previous session.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paywallExposure(
{Map< String, dynamic> properties = const {}}) → void - Track a paywall exposure.
-
reset(
) → Future< void> - Reset all local state. Generates new anonymous ID and session.
-
resetSession(
) → Future< void> - Start a new session. Call this on app foreground if you want session-based grouping of events.
-
revenue(
double amount, {Map< String, dynamic> properties = const {}}) → void - Track a revenue event.
-
screen(
String screenName, {Map< String, dynamic> properties = const {}}) → void - Track a screen/page view.
-
toString(
) → String -
A string representation of this object.
inherited
-
track(
String eventName, {Map< String, dynamic> properties = const {}, ActivationState? activationState}) → void - Track a custom event.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited