# fromEntity method Null safety

dynamic fromEntity(

1. String documentID,
2. PresentationEntity? entity

)

## Implementation

    static Future<PresentationModel?> fromEntity(
        String documentID, PresentationEntity? entity) async {
      if (entity == null) return null;
      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.fromEntity(counter.toString(), item);
              }).toList())),
        imagePositionRelative:
            toPresentationRelativeImagePosition(entity.imagePositionRelative),
        imageAlignment: toPresentationImageAlignment(entity.imageAlignment),
        imageWidth: entity.imageWidth,
        conditions: await StorageConditionsModel.fromEntity(entity.conditions),
      );
    }