toMap property

Map<String, String?> get toMap

Implementation

Map<String, String?> get toMap {
  Map<String, String?> eventMap = {'eventToken': _eventToken};

  if (_revenue != null) {
    eventMap['revenue'] = _revenue.toString();
  }
  if (_currency != null) {
    eventMap['currency'] = _currency;
  }
  if (transactionId != null) {
    eventMap['transactionId'] = transactionId;
  }
  if (callbackId != null) {
    eventMap['callbackId'] = callbackId;
  }
  if (_callbackParameters!.length > 0) {
    eventMap['callbackParameters'] = json.encode(_callbackParameters);
  }
  if (_partnerParameters!.length > 0) {
    eventMap['partnerParameters'] = json.encode(_partnerParameters);
  }

  return eventMap;
}