Flight.fromJson constructor

Flight.fromJson(
  1. Map<String, dynamic> json
)

Implementation

Flight.fromJson(Map<String, dynamic> json)
    : this.timeline = (json['timeline'] as List).map((i) {
        if (i['type'] ==
            EnumConvertion.convertToString(
                FlightElementType.waypointMission)) {
          return FlightElementWaypointMission.fromJson(i);
        } else {
          return FlightElement.fromJson(i);
        }
      }).toList();