# fromEntityPlus method Null safety

dynamic fromEntityPlus(

1. String documentID,
2. ListedItemEntity? entity,
3. {String? appId}

)

## Implementation

    static Future<ListedItemModel?> fromEntityPlus(
        String documentID, ListedItemEntity? entity,
        {String? appId}) async {
      if (entity == null) return null;

      PlatformMediumModel? imageHolder;
      if (entity.imageId != null) {
        try {
          imageHolder =
              await platformMediumRepository(appId: appId)!.get(entity.imageId);
        } on Exception catch (e) {
          print('Error whilst trying to initialise image');
          print(
              'Error whilst retrieving platformMedium with id ${entity.imageId}');
          print('Exception: $e');
        }
      }

      return ListedItemModel(
        documentID: documentID,
        description: entity.description,
        action: await ActionModel.fromEntityPlus(entity.action, appId: appId),
        image: imageHolder,
        posSize: await PosSizeModel.fromEntityPlus(entity.posSize, appId: appId),
      );
    }