HistoricalWeatherRsp.fromMap constructor

HistoricalWeatherRsp.fromMap(
  1. Map map
)

fromMap

Implementation

HistoricalWeatherRsp.fromMap(Map<dynamic, dynamic> map) {
  code = map['code'] as String;
  basic = Basic.fromMap(map['basic'] ?? Map());
  refer = Refer.fromMap(map['refer'] ?? Map());
  dailyWeather = HistoricalDailyWeather.fromMap(map['dailyBean'] ?? Map());
  hourlyWeatherList = List.from((map['hourlyBeans'] as List? ?? [])
      .map((v) => HistoricalHourlyWeather.fromMap(v)));
}