logAddToCart method
Future<void>
logAddToCart({
- List<
AnalyticsEventItem> ? items, - double? value,
- String? currency,
- Map<
String, Object?> ? parameters, - AnalyticsCallOptions? callOptions,
Logs the standard add_to_cart
event.
This event signifies that an item was added to a cart for purchase. Note: If you supply the
value
parameter, you must also supply the currency
parameter so that
revenue metrics can be computed accurately.
Implementation
Future<void> logAddToCart({
List<AnalyticsEventItem>? items,
double? value,
String? currency,
Map<String, Object?>? parameters,
AnalyticsCallOptions? callOptions,
}) {
_requireValueAndCurrencyTogether(value, currency);
_assertParameterTypesAreCorrect(parameters);
_assertItemsParameterTypesAreCorrect(items);
return _delegate.logEvent(
name: 'add_to_cart',
parameters: filterOutNulls(<String, Object?>{
_ITEMS: _marshalItems(items),
_VALUE: value,
_CURRENCY: currency,
if (parameters != null) ...parameters,
}),
callOptions: callOptions,
);
}