Track Events (Flutter)

Record user actions within your mobile or desktop application.

Overview

The EmpAnalytics.track() method is how you send data to Solvof. It safely queues the event in the local SQLite database. If the device is offline, the event remains in the queue and will be synced the next time the app opens with an active internet connection.

Syntax

dart
1EmpAnalytics.track(String eventName, {Map<String, dynamic>? properties});
ParameterTypeRequiredDescription
eventNameStringYesThe name of the event (e.g., 'Level Completed').
propertiesMap<String, dynamic>NoA dictionary of key-value pairs describing the event.

Basic Example

dart
1// Tracking with properties2EmpAnalytics.track("Purchase Completed", properties: {3  "Plan": "Premium",4  "Price": 29.99,5  "Currency": "USD",6});

Super Properties

Super Properties are automatically attached to every single event you track (e.g., App Version, User Role).

dart
1EmpAnalytics.registerSuperProperties({2  "App Version": "2.1.0",3  "Beta User": true4});

Force Flush

If you have critical events that must be sent immediately (e.g., just before the app is closed manually), you can bypass the batch timer and force a flush.

dart
1await EmpAnalytics.flush();