Map<String, dynamic> toJson() => { "segments": List<dynamic>.from(segments.map((x) => x.toJson())), "summary": summary.toJson(), "way_points": List<dynamic>.from(wayPoints.map((x) => x)), };