toJson method
Returns a Map with the object data
Implementation
Map<String, dynamic> toJson() {
return {
'coord': coord.toJson(),
'weather': List.generate(details.length, (i) => details[i].toJson()),
'main': temperature.toJson(),
'visibility': visibility,
'wind': wind.toJson(),
'clouds': clouds,
'dt': dt,
'timezone': timezone,
'sunrise': sunrise,
'sunset': sunset,
'id': id,
'name': name,
};
}