ReportSection.fromJson constructor

ReportSection.fromJson(
  1. Map<String, dynamic> data
)

Implementation

factory ReportSection.fromJson(
  Map<String, dynamic> data,
) => switch (data[keyType]) {
  AverageSection.sectionType => AverageSection.fromJson(data),
  LinearRegressionSection.sectionType => LinearRegressionSection.fromJson(
    data,
  ),
  TextualSummarySection.sectionType => TextualSummarySection.fromJson(data),
  GaugeComparisonSection.sectionType => GaugeComparisonSection.fromJson(data),
  DescriptiveStatsSection.sectionType => DescriptiveStatsSection.fromJson(
    data,
  ),
  _ => throw UnknownJsonTypeError(data[keyType]),
};