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?)?.toDouble() ?? 0.0,
    previousValue: (json['previous_value'] as num?)?.toDouble() ?? 0.0,
    growthRatePercentage:
        (json['growth_rate_percentage'] as num?)?.toDouble() ?? 0.0,
  );
}