toJson method
Converts the MPRouteLeg to a JSON representation that can be parsed by the MapsIndoors Platform SDK
Implementation
@override
Map<String, dynamic> toJson() {
var jsonMPRouteSteps = steps?.map((e) => e.toJson()).toList();
return {
"start_address": startAddress,
"end_address": endAddress,
"start_location": startLocation?.toJson(),
"end_location": endLocation?.toJson(),
"steps": jsonMPRouteSteps,
"distance": distance?.toJson(),
"duration": duration?.toJson()
};
}