mobile_skt/lib/models/dict_item.model.dart

54 lines
1.3 KiB
Dart
Raw Normal View History

class DictItemModel {
DictItemModel({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.creator,
required this.updater,
required this.label,
required this.value,
required this.orderNo,
required this.status,
required this.remark,
});
final int? id;
final DateTime? createdAt;
final DateTime? updatedAt;
final String? creator;
final String? updater;
final String? label;
final String? value;
final int? orderNo;
final int? status;
final String? remark;
factory DictItemModel.fromJson(Map<String, dynamic> json) {
return DictItemModel(
id: json["id"],
createdAt: DateTime.tryParse(json["createdAt"] ?? ""),
updatedAt: DateTime.tryParse(json["updatedAt"] ?? ""),
creator: json["creator"],
updater: json["updater"],
label: json["label"],
value: json["value"],
orderNo: json["orderNo"],
status: json["status"],
remark: json["remark"],
);
}
Map<String, dynamic> toJson() => {
"id": id,
"createdAt": createdAt?.toIso8601String(),
"updatedAt": updatedAt?.toIso8601String(),
"creator": creator,
"updater": updater,
"label": label,
"value": value,
"orderNo": orderNo,
"status": status,
"remark": remark,
};
}