EventTracker class

Responsible for tracking custom in-app events and managing the offline queue.

This tracker handles immediate event submission and falls back to a persistent EventQueue when the network is unavailable or requests fail.

Implemented types

Constructors

EventTracker({required NetworkManagerProtocol networkManager, required StorageManagerProtocol storageManager, required AttributionContext attributionContext, EventQueue? eventQueue})
Creates an event tracker

Properties

hashCode → int
The hash code for this object.
no setterinherited
queuedEventCount → int
Returns the number of queued events
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearQueue() → void
Clears the event queue
override
flushQueue() → Future<void>
Sends queued events in order. Stops at the first event that fails with an error worth retrying and keeps it at the head of the queue; drops an event the server rejects.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
trackEvent(String name, [Map<String, dynamic>? properties]) → Future<void>
Tracks a custom event
override
trackRevenue({required double amount, required String currency, Map<String, dynamic>? properties}) → Future<void>
Tracks a revenue-generating event.
override
trackScreenView(String name, [Map<String, dynamic>? properties]) → Future<void>
Tracks a screen view.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

isRetryable(Object error) → bool
Network failures and server errors (5xx) can succeed later; anything else (a 4xx, an event that can't be encoded) will fail the same way again.