fromJson static method

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

Implementation

static StatisticalValue? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return StatisticalValue(
    value: ((json['value'] as num?) ?? 0.0).toDouble(),
    previousValue: ((json['previous_value'] as num?) ?? 0.0).toDouble(),
    growthRatePercentage: ((json['growth_rate_percentage'] as num?) ?? 0.0)
        .toDouble(),
  );
}