|
- import 'package:farm_tpf/presentation/screens/codes/models/stamp_type.dart';
-
- import '../../../../custom_model/TbCropDTO.dart';
-
- class Stamp {
- int? id;
- TbCropDTO? tbCropDTO;
- String? code;
- num? quantity;
- String? description;
- String? pathImage;
- String? status;
- String? expiredDate;
- String? createdDate;
- StampType? stampType;
-
- Stamp({
- this.id,
- this.tbCropDTO,
- this.code,
- this.quantity,
- this.description,
- this.pathImage,
- this.status,
- this.expiredDate,
- this.createdDate,
- this.stampType,
- });
-
- Stamp.fromJson(Map<String, dynamic> json) {
- id = json['id'];
- tbCropDTO = json['TbCropDTO'] != null ? new TbCropDTO.fromJson(json['TbCropDTO']) : null;
- code = json['code'];
- quantity = json['quantity'];
- description = json['description'];
- pathImage = json['pathImage'];
- status = json['status'];
- expiredDate = json['expiredDate'];
- createdDate = json['createdDate'];
- stampType = json['tbExampleStamp'] != null ? new StampType.fromJson(json['tbExampleStamp']) : null;
- }
-
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- if (this.tbCropDTO != null) {
- data['TbCropDTO'] = this.tbCropDTO?.toJson();
- }
- data['code'] = this.code;
- data['quantity'] = this.quantity;
- data['description'] = this.description;
- data['pathImage'] = this.pathImage;
- data['status'] = this.status;
- data['expiredDate'] = this.expiredDate;
- data['createdDate'] = this.createdDate;
- if (this.stampType != null) {
- data['tbExampleStamp'] = this.stampType?.toJson();
- }
- return data;
- }
- }
|