trackEvent static method

Future<void> trackEvent(
  1. String eventName, {
  2. Map<String, String> properties = const {},
})

Track a custom event with name and optional string properties. The event name cannot be longer than 256. The property names and values are limited to 125 characters each. The number of properties per event is limited to 20. The property names or values cannot be null. The baseData and baseDataType properties are reserved.

Implementation

static Future<void> trackEvent(String eventName,
    {Map<String, String> properties = const {}}) async {
  _validateArgs(eventName, properties);

  return await AppCenter.instance.logService.addLog(EventLog(
      appLaunchTimestamp: AppCenter.instance.appLaunchTimestamp,
      sid: AppCenter.instance.sessionId,
      device: AppCenter.instance.deviceService.device,
      properties: properties,
      name: eventName));
}