toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['routeIndex'] = routeIndex;
data['distance'] = distance;
data['duration'] = duration;
data['geometry'] = geometry;
data['weight'] = weight;
data['weight_name'] = weightName;
if (legs != null) {
data['legs'] = legs!.map((v) => v.toJson()).toList();
}
if (routeOptions != null) {
data['routeOptions'] = routeOptions!.toJson();
}
data['voiceLocale'] = voiceLocale;
return data;
}