getItemMatches static method

Map<String, AppItemState> getItemMatches(
  1. Map<String, AppMediaItem> totalItems,
  2. List<String> profileItems
)

Implementation

static Map<String, AppItemState> getItemMatches(Map<String, AppMediaItem> totalItems, List<String> profileItems) {
  AppConfig.logger.t("Get Item Matches for ${totalItems.length} total items");
  Map<String, AppItemState> matchedItems = <String, AppItemState>{};

  try {
    totalItems.forEach((itemId, item) {
      if(profileItems.contains(itemId)) {
        matchedItems[itemId] = getItemState(item.state);
        AppConfig.logger.t("Adding Item Id: $itemId - Name: ${item.name}");
      }
    });
  } catch (e, st) {
    NeomErrorLogger.recordError(e, st, module: 'neom_core', operation: 'getItemMatches');
  }
  AppConfig.logger.d("Total ItemmMatches: ${matchedItems.length}");
  return matchedItems;
}