createArray static method
Create list of notifications from a string
Param String of inbox notifications return a list of InboxNotification
Implementation
static List<InboxNotification> createArray(String inboxNotifications) {
List<dynamic> list = json.decode(inboxNotifications);
List<InboxNotification> inboxNotificationList = [];
list.forEach((element) {
Map map = new Map();
if (Platform.isAndroid) {
map = json.decode(element.toString());
} else {
map = element;
}
InboxNotification inboxNotification = new InboxNotification(map);
inboxNotificationList.add(inboxNotification);
});
return inboxNotificationList;
}