toMap method Null safety

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

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'startCoord': this.startCoord?.toMap(),
    'startName': this.startName,
    'endCoord': this.endCoord?.toMap(),
    'endName': this.endName,
    'routeType': this.routeType != null ? this.routeType!.index : null,
    'transitPolicy': this.transitPolicy != null
        ? this.transitPolicy!.index + 3
        : null, // native 初始值为3
    'appScheme': this.appScheme,
    'isSupportWeb': this.isSupportWeb
  };
}