Weather.fromJson constructor

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

Cretes a Weather object from json

Implementation

factory Weather.fromJson(Map<String, dynamic> json) {
  return Weather(
    Coordinates.fromJson(json['coord']),
    Details.fromJsonArray(json['weather']),
    Temperature.fromJson(json['main']),
    json['visibility'],
    Wind.fromJson(json['wind']),
    json['clouds']['all'],
    Rain.fromJson(json['rain'] ?? {}),
    Snow.fromJson(json['snow'] ?? {}),
    json['dt'],
    json['timezone'],
    json['sys']['sunrise'],
    json['sys']['sunset'],
    json['id'],
    json['name'],
  );
}