class ProjectModel { ProjectModel({ required this.id, required this.createdAt, required this.updatedAt, required this.name, required this.isDelete, }); final int? id; final DateTime? createdAt; final DateTime? updatedAt; final String? name; final int? isDelete; factory ProjectModel.fromJson(Map json) { return ProjectModel( id: json["id"], createdAt: DateTime.tryParse(json["createdAt"] ?? ""), updatedAt: DateTime.tryParse(json["updatedAt"] ?? ""), name: json["name"], isDelete: json["isDelete"], ); } Map toJson() => { "id": id, "createdAt": createdAt?.toIso8601String(), "updatedAt": updatedAt?.toIso8601String(), "name": name, "isDelete": isDelete, }; }