toMap method Null safety

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

model -> map

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'startCoord': this.startCoord?.toMap(),
    'startName': this.startName,
    'endCoord': this.endCoord?.toMap(),
    'endName': this.endName,
    'naviType': this.naviType != null ? this.naviType!.index : null,
    'appScheme': this.appScheme,
    'appName': this.appName,
    'isSupportWeb': this.isSupportWeb,
    'preferenceType': this.preferenceType?.index,
    'height': this.height,
    'width': this.width,
    'weight': this.weight,
    'length': this.length,
    'axleWeight': this.axleWeight,
    'axleCount': this.axleCount,
    'isTrailer': this.isTrailer,
    'plateProvince': this.plateProvince,
    'plateNumber': this.plateNumber,
    'plateColor': this.plateColor,
    'displacement': this.displacement,
    'powerType': this.powerType,
    'emissionLimit': this.emissionLimit,
    'loadWeight': this.loadWeight
  };
}