fromDynamicItem static method

BaseItem fromDynamicItem(
  1. dynamic item
)

Implementation

static BaseItem fromDynamicItem(dynamic item) {

  BaseItem? baseItem = BaseItem();

  try {
    if (item is PlayableItem) {
      baseItem = fromPlayableItem(item);
    } else if(item is ExternalItem) {
      baseItem = fromExternalItem(item);
    }
  } catch (e, st) {
    NeomErrorLogger.recordError(e, st, module: 'neom_commons', operation: 'fromDynamicItem');
    throw Exception('Error mapping item to BaseItem: $e');
  }

  return baseItem;
}