track method Null safety

void track(
  1. String eventName,
  2. {Map<String, dynamic>? properties}

Track an event.

Every call to track eventually results in a data point sent to Mixpanel. These data points are what are measured, counted, and broken down to create your Mixpanel reports. Events have a string name, and an optional set of name/value pairs that describe the properties of that event.

  • eventName The name of the event to send
  • properties An optional map containing the key value pairs of the properties to include in this event.


void track(String eventName, {Map<String, dynamic>? properties}) {
  if (_MixpanelHelper.isValidString(eventName)) {
        <String, dynamic>{'eventName': eventName, 'properties': properties});
  } else {
    developer.log('`track` failed: eventName cannot be blank',
        name: 'Mixpanel');