fromEntityPlus static method
Future<DocumentModel?>
fromEntityPlus(
- String documentID,
- DocumentEntity? entity, {
- String? appId,
Implementation
static Future<DocumentModel?> fromEntityPlus(
String documentID, DocumentEntity? entity,
{String? appId}) async {
if (entity == null) return null;
var counter = 0;
return DocumentModel(
documentID: documentID,
appId: entity.appId ?? '',
description: entity.description,
content: entity.content,
padding: entity.padding,
images: entity.images == null
? null
: List<DocumentItemModel>.from(
await Future.wait(entity.images!.map((item) {
counter++;
return DocumentItemModel.fromEntityPlus(counter.toString(), item,
appId: appId);
}).toList())),
background:
await BackgroundModel.fromEntityPlus(entity.background, appId: appId),
conditions: await StorageConditionsModel.fromEntityPlus(entity.conditions,
appId: appId),
);
}