toMap method Null safety

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

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'distance': this.distance,
    'duration': this.duration?.toMap(),
    'starting': this.starting?.toMap(),
    'terminal': this.terminal?.toMap(),
    'title': this.title,
    'steps': this.steps?.map((e) => e.toMap()).toList(),
    'wayPoints': this.wayPoints?.map((e) => e.toMap()).toList(),
    'lightNum': this.lightNum,
    'congestionMetres': this.congestionMetres,
    'taxiFares': this.taxiFares
  };
}