AppFit class
AppFit handles all of the event tracking for the AppFit dashboard.
To use the AppFit SDK, you must first initialize it with an AppFitConfiguration.
final configuration = AppFitConfiguration(apiKey: 'key');
final appfit = AppFit(configuration: configuration);
appfit.trackEvent('event');
Constructors
- AppFit({required AppFitConfiguration configuration, EventDigester? eventDigester})
-
Initializes the AppFit SDK with the provided configuration and optional
eventDigesterfor testing purposes.
Properties
- configuration → AppFitConfiguration
-
The configuration for the AppFit SDK.
final
- eventDigester → EventDigester
-
The event digester for the AppFit SDK.
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
-
identifyUser(
String? userId) → void -
Identifies the user with the provided
userId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
track(
AppFitEvent event) → void -
Tracks an event with the provided
event. -
trackEvent(
String eventName, {Map< String, dynamic> ? properties}) → void -
Tracks an event with the provided
eventNameandproperties.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createInstance(
{required AppFitConfiguration configuration, String instanceName = "default"}) → AppFit -
Create a new shared instance of the AppFit SDK with the provided
configurationand optionalinstanceName. -
getInstance(
{String instanceName = "default"}) → AppFit -
Retrieve the shared instance of the AppFit SDK with the provided
instanceName. If noinstanceNameis provided, the default instance will be returned.