VehicleModel.fromJson constructor

VehicleModel.fromJson(
  1. Map<String, dynamic> json,
  2. bool owned
)

Implementation

VehicleModel.fromJson(Map<String,dynamic> json,bool owned) {
  vehicleName = json["vehicleName"] ?? "";
  renewalPrice = json["renewalPrice"] ?? 0;
  orderPrice = json["orderPrice"] ?? 0;
  nobility = json["nobility"] ?? 0;
  remainderDays = json["remainderDays"] ?? 0;
  id = json["id"] ?? 0;
  vehicleId = json["vehicleId"] ?? 0;
  usedState = json["usedState"] ?? 0;
  vehicleGif = json["vehicleGif"] ?? "";
  userId = json["userId"] ?? 0;
  vehiclePic = json["vehiclePic"] ?? "";
  expiredTime = json["expiredTime"] ?? "";
  vehicleType = json["vehicleType"] ?? 0;
  title = json["title"] ?? "";
  hasOwned = owned;
}