eventElapsedTime method Null safety

Future<double?> eventElapsedTime(
  1. String eventName
)

Retrieves the time elapsed for the named event since timeEvent() was called.

  • eventName the name of the event to be tracked that was previously called with timeEvent()

Time elapsed since timeEvent(String) was called for the given eventName.

Implementation

Future<double?> eventElapsedTime(String eventName) async {
  if (_MixpanelHelper.isValidString(eventName)) {
    return await _channel.invokeMethod<double>(
        'eventElapsedTime', <String, dynamic>{'eventName': eventName});
  } else {
    return 0;
  }
}