track method

dynamic track(
  1. String trackName, [
  2. dynamic arguments
])

Implementation

track(String trackName, [dynamic arguments]) {
  if (trackName == null || trackName.trim().length == 0) {
    throw new Exception(
        "trackName is invalid. Please provide a valid name for track");
  }

  var _data = {};
  for (var key in arguments.keys) {
    if (arguments[key].runtimeType == DateTime) {
      _data['@CHKDATE_' + key] =
          arguments[key].millisecondsSinceEpoch.toString();
    } else {
      _data[key] = arguments[key];
    }
  }

  var params = <String, dynamic>{'data': _data, 'trackName': trackName};

  _channel.invokeMethod("track", params);
}