MoonRsp.fromMap constructor Null safety

MoonRsp.fromMap(
  1. Map map
)

Implementation

MoonRsp.fromMap(Map<dynamic, dynamic> map) {
  code = map['code'] as String;
  basic = Basic.fromMap(map['basic'] ?? Map());
  refer = Refer.fromMap(map['refer'] ?? Map());
  moon = Moon.fromMap(map);
  moonPhaseList = List.from((map['moonPhaseBeanList'] as List? ?? [])
      .map((v) => MoonPhase.fromMap(v)));
}