setAnalytics method

void setAnalytics(
  1. AnalyticsType analyticsType, {
  2. String? cloudName,
  3. String? publicId,
})

Implementation

void setAnalytics(AnalyticsType analyticsType,
    {String? cloudName, String? publicId}) {
  switch (analyticsType) {
    case AnalyticsType.auto:
      eventsManager.trackingType = TrackingType.auto;
      eventsManager.cloudName = cloudName ?? eventsManager.cloudName;
      eventsManager.publicId = publicId ?? this.publicId;
      break;
    case AnalyticsType.manual:
      eventsManager.trackingType = TrackingType.manual;
      eventsManager.cloudName = cloudName ?? eventsManager.cloudName;
      eventsManager.publicId = publicId ?? this.publicId;
      break;
    case AnalyticsType.disabled:
      analytics = false;
      removeListeners();
      break;
  }
}