DirectionRoute.fromJson constructor

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

Implementation

DirectionRoute.fromJson(Map<String, dynamic> json) {
  routeIndex = json['routeIndex'];
  distance = json['distance'];
  duration = json['duration'];
  geometry = json['geometry'];
  weight = json['weight'];
  weightName = json['weight_name'];
  if (json['legs'] != null) {
    legs = <Legs>[];
    json['legs'].forEach((v) {
      legs!.add(Legs.fromJson(v));
    });
  }
  routeOptions = json['routeOptions'] != null
      ? RouteOptions.fromJson(json['routeOptions'])
      : null;
  voiceLocale = json['voiceLocale'];
}