toJson method Null safety

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() => {
      "coord": coord.toJson(),
      "weather": List<dynamic>.from(weather.map((x) => x.toJson())),
      "base": base,
      "main": main.toJson(),
      "visibility": visibility,
      "wind": wind.toJson(),
      "snow": snow?.toJson(),
      "rain": rain?.toJson(),
      "clouds": clouds.toJson(),
      "dt": dt,
      "sys": sys.toJson(),
      "timezone": timezone,
      "id": id,
      "name": name,
      "cod": cod,
    };