fromJson static method

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

Implementation

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

  return CurrentWeather(
    temperature: ((json['temperature'] as num?) ?? 0.0).toDouble(),
    emoji: (json['emoji'] as String?) ?? '',
  );
}