From dc2dab5869e84cbdaa560af9c9a542dd0b83ebd3 Mon Sep 17 00:00:00 2001 From: zaid_daoud Date: Thu, 31 Aug 2023 15:57:56 +0300 Subject: [PATCH] Multiple Images Everywhere --- lib/models/pantry/pentry.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"]), );