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.

62 lines
1.6KB

  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? description;
  9. String? pathImage;
  10. String? status;
  11. String? expiredDate;
  12. String? createdDate;
  13. StampType? stampType;
  14. Stamp({
  15. this.id,
  16. this.tbCropDTO,
  17. this.code,
  18. this.quantity,
  19. this.description,
  20. this.pathImage,
  21. this.status,
  22. this.expiredDate,
  23. this.createdDate,
  24. this.stampType,
  25. });
  26. Stamp.fromJson(Map<String, dynamic> json) {
  27. id = json['id'];
  28. tbCropDTO = json['TbCropDTO'] != null ? new TbCropDTO.fromJson(json['TbCropDTO']) : null;
  29. code = json['code'];
  30. quantity = json['quantity'];
  31. description = json['description'];
  32. pathImage = json['pathImage'];
  33. status = json['status'];
  34. expiredDate = json['expiredDate'];
  35. createdDate = json['createdDate'];
  36. stampType = json['tbExampleStamp'] != null ? new StampType.fromJson(json['tbExampleStamp']) : null;
  37. }
  38. Map<String, dynamic> toJson() {
  39. final Map<String, dynamic> data = new Map<String, dynamic>();
  40. data['id'] = this.id;
  41. if (this.tbCropDTO != null) {
  42. data['TbCropDTO'] = this.tbCropDTO?.toJson();
  43. }
  44. data['code'] = this.code;
  45. data['quantity'] = this.quantity;
  46. data['description'] = this.description;
  47. data['pathImage'] = this.pathImage;
  48. data['status'] = this.status;
  49. data['expiredDate'] = this.expiredDate;
  50. data['createdDate'] = this.createdDate;
  51. if (this.stampType != null) {
  52. data['tbExampleStamp'] = this.stampType?.toJson();
  53. }
  54. return data;
  55. }
  56. }