Skip to content

Instantly share code, notes, and snippets.

@yunus-floo
Last active May 9, 2022 15:19
Show Gist options
  • Save yunus-floo/18138d869b5d1ea44fa9c5a602369c34 to your computer and use it in GitHub Desktop.
Save yunus-floo/18138d869b5d1ea44fa9c5a602369c34 to your computer and use it in GitHub Desktop.
class AttachmentDTO {
int id;
String local_path;
String path_file;
String parent_id;
String type;
AttachmentDTO({this.id, this.local_path, this.parent_id, this.path_file, this.type});
factory Attachment.fromJson(Map<String, dynamic> json) => Attachment(
id: json["id"],
parent_id: json["parent_id"],
type: json["type"],
path_file: json["path_file"],
local_path: json["local_path"],
);
Map<String, dynamic> toJson() => {
"id": id,
"parent_id": parent_id,
"type": type,
"path_file": path_file,
"local_path": local_path,
};
Attachment toEntity() => Attachment(id: id, parent_id: parent_id, type: type, path_file: path_file, local_path:local_path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment