toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['distance'] = distance;
  data['duration'] = duration;
  data['geometry'] = geometry;
  data['name'] = name;
  data['mode'] = mode;
  if (maneuver != null) {
    data['maneuver'] = maneuver!.toJson();
  }
  if (voiceInstructions != null) {
    data['voiceInstructions'] =
        voiceInstructions!.map((v) => v.toJson()).toList();
  }
  if (bannerInstructions != null) {
    data['bannerInstructions'] =
        bannerInstructions!.map((v) => v.toJson()).toList();
  }
  data['driving_side'] = drivingSide;
  data['weight'] = weight;
  if (intersections != null) {
    data['intersections'] = intersections!.map((v) => v.toJson()).toList();
  }
  data['exits'] = exits;
  return data;
}