logEvent method

Future<void> logEvent(
  1. String name, [
  2. Map<String, Object> parameters = const {'source' : 'currentScreenName'}
])

Implementation

Future<void> logEvent(
  String name, [
  Map<String, Object> parameters = const {'source': 'currentScreenName'},
]) async {
  logging.info('logEvent() - name: $name, parameters: $parameters');
  if (name.length > 40) {
    logging.severe(
        'Event names must be a maximum of 40 characters. name: $name');

    throw AnalyticsDataSourceException();
  }

  if (parameters['source'] == null) {
    logging.severe('Event must have a source value');
    throw AnalyticsDataSourceException();
  }

  return _instance.analytics.logEvent(name: name, parameters: parameters);
}