# fromEntityPlus method Null safety

dynamic fromEntityPlus(

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

)

## Implementation

    static Future<PresentationModel?> fromEntityPlus(
        String documentID, PresentationEntity? 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');
        }
      }

      var counter = 0;
      return PresentationModel(
        documentID: documentID,
        appId: entity.appId ?? '',
        description: entity.description,
        bodyComponents: entity.bodyComponents == null
            ? null
            : List<BodyComponentModel>.from(
                await Future.wait(entity.bodyComponents!.map((item) {
                counter++;
                return BodyComponentModel.fromEntityPlus(counter.toString(), item,
                    appId: appId);
              }).toList())),
        image: imageHolder,
        imagePositionRelative:
            toPresentationRelativeImagePosition(entity.imagePositionRelative),
        imageAlignment: toPresentationImageAlignment(entity.imageAlignment),
        imageWidth: entity.imageWidth,
        conditions: await StorageConditionsModel.fromEntityPlus(entity.conditions,
            appId: appId),
      );
    }