createClient function

Analytics createClient(
  1. Configuration configuration
)

Implementation

Analytics createClient(Configuration configuration) {
  if (configuration.debug) {
    Analytics.debug = true;
  }
  if (configuration.flushPolicies == null) {
    configuration = setFlushPolicies(configuration, defaultFlushPolicies);
  }

  final analytics = Analytics(configuration, storeFactory());

  if (configuration.debug) {
    analytics.addPlugin(EventLogger());
  }

  analytics.init();
  ScreenObserver().screenStream.listen((name) {
    analytics.screen(name);
  });

  return analytics;
}