AiutaAnalyticEvent.fromJson constructor

AiutaAnalyticEvent.fromJson(
  1. Map<String, dynamic> json
)

Creates an analytic event from a JSON object.

Implementation

factory AiutaAnalyticEvent.fromJson(Map<String, dynamic> json) {
  switch (json['type'] as String) {
    case 'pageEvent':
      return AiutaAnalyticPageEvent.fromJson(json);
    case 'onboardingEvent':
      return AiutaAnalyticOnboardingEvent.fromJson(json);
    case 'pickerEvent':
      return AiutaAnalyticsPickerEvent.fromJson(json);
    case 'exitEvent':
      return AiutaAnalyticExitEvent.fromJson(json);
    case 'tryOnEvent':
      return AiutaAnalyticsTryOnEvent.fromJson(json);
    case 'resultsEvent':
      return AiutaAnalyticsResultsEvent.fromJson(json);
    case 'feedbackEvent':
      return AiutaAnalyticsFeedbackEvent.fromJson(json);
    case 'historyEvent':
      return AiutaAnalyticsHistoryEvent.fromJson(json);
    default:
      throw Exception('Unknown analytic type');
  }
}