ForecastRsp.fromMap constructor Null safety

ForecastRsp.fromMap(
  1. Map map
)

fromMap

Implementation

ForecastRsp.fromMap(Map<dynamic, dynamic> map) {
  code = map['code'] as String;
  basic = Basic.fromMap(map['basic'] ?? Map());
  refer = Refer.fromMap(map['refer'] ?? Map());
  forecastList = (map["forecastList"] as List? ?? [])
      .map((v) => Forecast.fromMap(v))
      .toList();
}