import 'image.dart'; class FileModel { int id; String name; ImageModel preview; int size; String type; String url; FileModel({ this.id, this.name, this.preview, this.size, this.type, this.url, }); factory FileModel.fromJson(Map json) => FileModel( id: json["id"], name: json["name"], preview: json["image"] == null ? null : ImageModel.fromJson(json["image"]), size: json["size"], type: json["type"], url: json["url"], ); Map toJson() => { "id": id, "name": name, "preview": preview, "size": size, "type": type, "url": url, }; }