toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['restriction'] = restriction;
data['polyline'] = polyline;
data['distance'] = distance;
if (steps != null) {
data['steps'] = steps!.map((v) => v.toJson()).toList();
}
data['totalTrafficLights'] = totalTrafficLights;
data['duration'] = duration;
data['strategy'] = strategy;
data['tollDistance'] = tollDistance;
data['tolls'] = tolls;
return data;
}