toJson method

Map<String, dynamic> toJson()

Returns a Map with the object data

Implementation

Map<String, dynamic> toJson() {
  return {
    'dt': dt,
    'sunrise': sunrise,
    'sunset': sunset,
    'temp': temperature.toJson(),
    'feels_like': feelsLike.toJson(),
    'pressure': pressure,
    'humidity': humidity,
    'dew_point': dewPoint,
    'wind': wind.toJson(),
    'weather': List.generate(details.length, (i) => details[i].toJson()),
    'clouds': clouds,
    'pop': pop,
    'rain': rain,
    'snow': snow,
    'uvi': uvi,
  };
}