Leg.fromJson constructor

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

Implementation

factory Leg.fromJson(Map<String, dynamic> json) => Leg(
  viaWaypoints: List<dynamic>.from(json["via_waypoints"].map((x) => x)),
  admins: List<Admin>.from(json["admins"].map((x) => Admin.fromJson(x))),
  annotation:
      json["annotation"] != null
          ? Annotation.fromJson(json["annotation"])
          : null,
  weightTypical: json["weight_typical"]?.toDouble(),
  durationTypical: json["duration_typical"]?.toDouble(),
  weight: json["weight"]?.toDouble(),
  duration: json["duration"]?.toDouble(),
  steps: List<Step>.from(json["steps"].map((x) => Step.fromJson(x))),
  distance: json["distance"]?.toDouble(),
  summary: json["summary"],
);