toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the MPRouteStep to a JSON representation that can be parsed by the MapsIndoors Platform SDK

Implementation

@override
Map<String, dynamic> toJson() {
  var jsonRouteSteps = steps?.map((e) => e.toJson()).toList();
  var jsonGeometry = geometry?.map((e) => e.toJson()).toList();
  return {
    "distance": distance?.toJson(),
    "duration": duration?.toJson(),
    "start_location": startLocation?.toJson(),
    "end_location": endLocation?.toJson(),
    "geometry": jsonGeometry,
    "highway": highway,
    "abutters": abutters,
    "html_instructions": htmlInstructions,
    "maneuver": maneuver,
    "travel_mode": travelMode,
    "steps": jsonRouteSteps,
    "available_travel_modes": availableTravelModes
  };
}