class DictItemModel {
  DictItemModel({
    this.id,
    this.createdAt,
    this.updatedAt,
    this.creator,
    this.updater,
    required this.label,
    this.value,
    this.orderNo,
    this.status,
    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,
      };
}
