RudderSdkPlatform class abstract
Platform interface for the RudderStack Flutter SDK.
This abstract class defines the contract that platform-specific implementations must follow. It provides the core API for analytics event tracking including initialization, user identification, event tracking, screen tracking, group tracking, and session management.
Platform-specific implementations (Android, iOS, Web) extend this class and provide concrete implementations for each method.
- Inheritance
-
- Object
- PlatformInterface
- RudderSdkPlatform
Constructors
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
-
alias(
String newId, {RudderOption? options}) → void - Creates an alias linking two user identities.
-
endSession(
) → void - Manually ends the current session.
-
getRudderContext(
) → Future< Map?> - Retrieves the current RudderStack context information.
-
getSessionId(
) → Future< int?> - Retrieves the current session ID.
-
group(
String groupId, {RudderTraits? groupTraits, RudderOption? options}) → void - Associates a user with a group or organization.
-
identify(
String userId, {RudderTraits? traits, RudderOption? options}) → void - Associates a user identity with their actions and traits.
-
initialize(
String writeKey, {RudderConfig? config, RudderOption? options}) → void - Initializes the RudderStack SDK with the provided configuration.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optOut(
bool optOut) → void - Controls whether the SDK should collect and send data.
-
putAdvertisingId(
String advertisingId) → void - Sets the advertising identifier for the device.
-
putAnonymousId(
String anonymousId) → void - Sets a custom anonymous identifier for the user.
-
putDeviceToken(
String deviceToken) → void - Sets the device token for push notifications.
-
reset(
{bool clearAnonymousId = false}) → void - Resets the user state and clears all user data.
-
screen(
String screenName, {String? category, RudderProperty? properties, RudderOption? options}) → void - Records screen views and page visits.
-
startSession(
{int? sessionId}) → void - Manually starts a new session with an optional custom session ID.
-
toString(
) → String -
A string representation of this object.
inherited
-
track(
String eventName, {RudderProperty? properties, RudderOption? options}) → void - Records user actions and events with optional properties.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ RudderSdkPlatform
-
The default instance of RudderSdkPlatform to use.
getter/setter pair