logViewItem method

Future<void> logViewItem({
  1. String? currency,
  2. double? value,
  3. List<AnalyticsEventItem>? items,
})

Logs the standard view_item event.

This event signifies that some content was shown to the user. This content may be a product, a webpage or just a simple image or text. Use the appropriate parameters to contextualize the event. Use this event to discover the most popular items viewed in your app. Note: If you supply the value parameter, you must also supply the currency parameter so that revenue metrics can be computed accurately.

See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#VIEW_ITEM

Implementation

Future<void> logViewItem({
  String? currency,
  double? value,
  List<AnalyticsEventItem>? items,
}) {
  _requireValueAndCurrencyTogether(value, currency);

  return logEvent(
    name: 'view_item',
    parameters: filterOutNulls(<String, Object?>{
      _CURRENCY: currency,
      _VALUE: value,
      _ITEMS: items,
    }),
  );
}