toMap method Null safety

  1. @override
Map<String, Object?> toMap()
override

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'distance': this.distance,
    'duration': this.duration,
    'points': this.points?.map((e) => e.toMap()).toList(),
    'pointsCount': this.pointsCount,
    'name': this.name,
    'entraceCoor': this.entraceCoor?.toMap(),
    'exitCoor': this.exitCoor?.toMap(),
    'instructions': this.instructions,
    'stepType': this.stepType?.index,
    'vehicleInfo': this.vehicleInfo?.toMap(),
    'trafficConditions':
        this.trafficConditions?.map((e) => e.toMap()).toList(),
  };
}