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?)?.toDouble() ?? 0.0,
    emoji: (json['emoji'] as String?) ?? '',
  );
}