sendEvent static method

void sendEvent(
  1. NetmeraEvent event
)

Implementation

static void sendEvent(NetmeraEvent event) {
  final originalJson = event.toJson();
  final processedJson = originalJson.map<String, dynamic>((key, value) {
    if (value is DateTime) {
      return MapEntry(key, value.millisecondsSinceEpoch);
    } else if (value is List<DateTime>) {
      return MapEntry(
        key,
        value.map((date) => date.millisecondsSinceEpoch).toList(),
      );
    }
    return MapEntry(key, value);
  });
  _platform.invokeMethod(_SEND_EVENT, processedJson);
}