You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7KB

  1. import 'package:farm_tpf/presentation/screens/codes/models/stamp_type.dart';
  2. import '../../../../custom_model/TbCropDTO.dart';
  3. class Stamp {
  4. int? id;
  5. TbCropDTO? tbCropDTO;
  6. String? code;
  7. num? quantity;
  8. String? productName;
  9. String? description;
  10. String? pathImage;
  11. String? status;
  12. String? expiredDate;
  13. String? createdDate;
  14. StampType? stampType;
  15. Stamp({
  16. this.id,
  17. this.tbCropDTO,
  18. this.code,
  19. this.quantity,
  20. this.productName,
  21. this.description,
  22. this.pathImage,
  23. this.status,
  24. this.expiredDate,
  25. this.createdDate,
  26. this.stampType,
  27. });
  28. Stamp.fromJson(Map<String, dynamic> json) {
  29. id = json['id'];
  30. tbCropDTO = json['tbCrop'] != null ? new TbCropDTO.fromJson(json['tbCrop']) : null;
  31. code = json['code'];
  32. quantity = json['quantity'];
  33. productName = json['productName'];
  34. description = json['description'];
  35. pathImage = json['pathImage'];
  36. status = json['status'];
  37. expiredDate = json['expiredDate'];
  38. createdDate = json['createdDate'];
  39. stampType = json['tbExampleStamp'] != null ? new StampType.fromJson(json['tbExampleStamp']) : null;
  40. }
  41. Map<String, dynamic> toJson() {
  42. final Map<String, dynamic> data = new Map<String, dynamic>();
  43. data['id'] = this.id;
  44. if (this.tbCropDTO != null) {
  45. data['tbCrop'] = this.tbCropDTO?.toJson();
  46. }
  47. data['code'] = this.code;
  48. data['quantity'] = this.quantity;
  49. data['productName'] = this.productName;
  50. data['description'] = this.description;
  51. data['pathImage'] = this.pathImage;
  52. data['status'] = this.status;
  53. data['expiredDate'] = this.expiredDate;
  54. data['createdDate'] = this.createdDate;
  55. if (this.stampType != null) {
  56. data['tbExampleStamp'] = this.stampType?.toJson();
  57. }
  58. return data;
  59. }
  60. }