logSearch method

Future<void> logSearch({
  1. required String searchTerm,
  2. int? numberOfNights,
  3. int? numberOfRooms,
  4. int? numberOfPassengers,
  5. String? origin,
  6. String? destination,
  7. String? startDate,
  8. String? endDate,
  9. String? travelClass,
  10. Map<String, Object>? parameters,
  11. AnalyticsCallOptions? callOptions,
})

Logs the standard search event.

Apps that support search features can use this event to contextualize search operations by supplying the appropriate, corresponding parameters. This event can help you identify the most popular content in your app.

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

Implementation

Future<void> logSearch({
  required String searchTerm,
  int? numberOfNights,
  int? numberOfRooms,
  int? numberOfPassengers,
  String? origin,
  String? destination,
  String? startDate,
  String? endDate,
  String? travelClass,
  Map<String, Object>? parameters,
  AnalyticsCallOptions? callOptions,
}) {
  _assertParameterTypesAreCorrect(parameters);

  return _delegate.logEvent(
    name: 'search',
    parameters: filterOutNulls(
      <String, Object?>{
        _SEARCH_TERM: searchTerm,
        _NUMBER_OF_NIGHTS: numberOfNights,
        _NUMBER_OF_ROOMS: numberOfRooms,
        _NUMBER_OF_PASSENGERS: numberOfPassengers,
        _ORIGIN: origin,
        _DESTINATION: destination,
        _START_DATE: startDate,
        _END_DATE: endDate,
        _TRAVEL_CLASS: travelClass,
        if (parameters != null) ...parameters,
      },
    ),
    callOptions: callOptions,
  );
}