WeatherHourlyResp.fromMap constructor

WeatherHourlyResp.fromMap(
  1. Map map
)

fromMap

Implementation

WeatherHourlyResp.fromMap(Map<dynamic, dynamic> map) {
  code = map['code'] as String;
  basic = Basic.fromMap(map['basic'] ?? Map());
  refer = Refer.fromMap(map['refer'] ?? Map());
  hourly = map.containsKey('hourly')
      ? (map['hourly'] as List).map((v) => WeatherHourly.fromMap(v)).toList()
      : [];
}