AirNowResp.fromMap constructor

AirNowResp.fromMap(
  1. Map map
)

fromMap

Implementation

AirNowResp.fromMap(Map<dynamic, dynamic> map) {
  code = map['code'] as String;
  basic = Basic.fromMap(map['basic'] ?? Map());
  refer = Refer.fromMap(map['refer'] ?? Map());
  now = AirNow.fromMap(map['now'] ?? Map());
  stations = map.containsKey('airNowStationBean')
      ? (map['airNowStationBean'] as List)
          .map((v) => StationNow.fromMap(v))
          .toList()
      : [];
}