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 (receipt != null) {
    eventMap['receipt'] = receipt;
  }
  if (productId != null) {
    eventMap['productId'] = productId;
  }
  if (purchaseToken != null) {
    eventMap['purchaseToken'] = purchaseToken;
  }
  if (callbackId != null) {
    eventMap['callbackId'] = callbackId;
  }
  if (_callbackParameters!.length > 0) {
    eventMap['callbackParameters'] = json.encode(_callbackParameters);
  }
  if (_eventParameters!.length > 0) {
    eventMap['eventValueParameters'] = json.encode(_eventParameters);
  }
  if (_partnerParameters!.length > 0) {
    eventMap['partnerParameters'] = json.encode(_partnerParameters);
  }

  return eventMap;
}