diff --git a/lib/models/pantry/pentry.dart b/lib/models/pantry/pentry.dart index f2b5dfee..68fd85dd 100644 --- a/lib/models/pantry/pentry.dart +++ b/lib/models/pantry/pentry.dart @@ -117,7 +117,11 @@ class Pentry { if (map['vKits'] != null) { pmKits = (map['vKits'] as List).map((e) => PMKit.fromMap(e as Map)).toList(); } - + List files = []; + if (map["vAttachments"] != null) if (map["vAttachments"] is List) { + List list = map["vAttachments"]; + files = list.map((e) => URLs.getFileUrl(e["name"])).toList(); + } List ppmCheckLists = []; if (map['vChecklists'] != null) { ppmCheckLists = (map['vChecklists'] as List).map((e) => PPMCheckList.fromMap(e as Map)).toList(); @@ -142,6 +146,7 @@ class Pentry { ppmCheckLists: ppmCheckLists, calibrationTools: calibrationTools, pmKits: pmKits, + files: files.map((e) => File(e)).toList(), signatureNurse: URLs.getFileUrl(map["nurseSignature"]), signatureEngineer: URLs.getFileUrl(map["engSignature"]), );