import 'step_model.dart'; import 'info_model.dart'; import '../address/Geometry.dart'; part 'route_point.g.dart'; class RoutePoint { Info? distance; Info? duration; String? endAddress; Location? endLocation; String? startAddress; Location? startLocation; List? steps; RoutePoint( {this.distance, this.duration, this.endAddress, this.endLocation, this.startAddress, this.startLocation, this.steps}); Map toJson() => { "distance": distance, "duration": duration, "end_address": endAddress, "end_location": endLocation, "start_address": startAddress, "start_location": startLocation, if (steps != null) "steps": List.from(steps!.map((x) => x.toJson())), }; factory RoutePoint.fromJson(Map json) => _$RoutePointFromJson(json); }