car_model.dart 626 B

12345678910111213141516171819202122232425262728293031
  1. /// Description: car model
  2. /// Time : 09/04/2023 Monday
  3. /// Author : liuyuqi.gov@msn.cn
  4. class CarModel {
  5. int id;
  6. String brand;
  7. String type;
  8. bool start;
  9. CarModel({
  10. required this.id,
  11. required this.brand,
  12. required this.type,
  13. this.start = false,
  14. });
  15. CarModel.fromJson(Map<String, dynamic> json)
  16. : id = json['id'],
  17. brand = json['brand'],
  18. type = json['type'],
  19. start = json['start'] == 1 ? true : false;
  20. Map<String, dynamic> toJson() {
  21. return {
  22. 'id': id,
  23. 'brand': brand,
  24. 'type': type,
  25. 'start': start == true ? 1 : 0,
  26. };
  27. }
  28. }