revenue method

Future<void> revenue(
  1. Revenue revenue, [
  2. EventOptions? options
])

Tracks revenue generated by a user.

Example:

final revenue = Revenue()
  ..price = 3.99
  ..quantity = 3
  ..productId = 'com.company.productId';
amplitude.revenue(revenue);

Implementation

Future<void> revenue(Revenue revenue, [EventOptions? options]) async {
  if (!revenue.isValid()) {
    // TODO(xinyi): logger.warn('Invalid revenue object, missing required fields')
    return;
  }
  final event = revenue.toRevenueEvent();
  if (options != null) {
    event.mergeEventOptions(options);
  }

  return await _channel.invokeMethod('revenue',
      {'instanceName': configuration.instanceName, 'event': event.toMap()});
}