BMFDrivingRouteLine.fromMap constructor Null safety

BMFDrivingRouteLine.fromMap(
  1. Map map
)

map => BMFDrivingRouteLine

Implementation

BMFDrivingRouteLine.fromMap(Map map) : super.fromMap(map) {
  if (map['steps'] != null) {
    List<BMFDrivingStep> tmpSteps = [];

    map['steps'].forEach((v) {
      tmpSteps.add(BMFDrivingStep.fromMap(v as Map));
    });
    steps = tmpSteps;
  }
  if (map['wayPoints'] != null) {
    List<BMFPlanNode> tmpWayPoints = [];

    map['wayPoints'].forEach((v) {
      tmpWayPoints.add(BMFPlanNode.fromMap(v as Map));
    });
    wayPoints = tmpWayPoints;
  }
  lightNum = map['lightNum'];
  congestionMetres = map['congestionMetres'];
  taxiFares = map['taxiFares'];
}