toMap method Null safety

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

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'from': this.from?.toMap(),
    'to': this.to?.toMap(),
    'routePlanType': this.routePlanType?.index,
    'cityID': this.cityID,
    'routeIndex': this.routeIndex
  };
}