toMap method

Map<String, Object?> toMap()

Converts the ecommerce transaction item object to JSON.

Implementation

Map<String, Object?> toMap() {
  return {
    'itemId': itemId,
    'sku': sku,
    'price': price,
    'quantity': quantity,
    'name': name,
    'category': category,
    'currency': currency,
    'contexts': contexts.map((context) => context.toMap()).toList()
  };
}