fromEntity static method

Future<DynamicWidgetModel?> fromEntity(
  1. String documentID,
  2. DynamicWidgetEntity? entity
)

Implementation

static Future<DynamicWidgetModel?> fromEntity(
    String documentID, DynamicWidgetEntity? entity) async {
  if (entity == null) return null;
  return DynamicWidgetModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    description: entity.description,
    content: entity.content,
    background: await BackgroundModel.fromEntity(entity.background),
    conditions: await StorageConditionsModel.fromEntity(entity.conditions),
  );
}