fromEntity static method

Future<GridViewModel?> fromEntity(
  1. String documentID,
  2. GridViewEntity? entity
)

Implementation

static Future<GridViewModel?> fromEntity(
    String documentID, GridViewEntity? entity) async {
  if (entity == null) return null;
  return GridViewModel(
    documentID: documentID,
    appId: entity.appId ?? '',
    name: entity.name,
    scrollDirection: toGridViewScrollDirection(entity.scrollDirection),
    type: toGridViewGridType(entity.type),
    crossAxisCount: entity.crossAxisCount,
    maxCrossAxisExtentType:
        toMaxCrossAxisExtentType(entity.maxCrossAxisExtentType),
    absoluteMaxCrossAxisExtent: entity.absoluteMaxCrossAxisExtent,
    relativeMaxCrossAxisExtent: entity.relativeMaxCrossAxisExtent,
    childAspectRatio: entity.childAspectRatio,
    padding: entity.padding,
    mainAxisSpacing: entity.mainAxisSpacing,
    crossAxisSpacing: entity.crossAxisSpacing,
    conditions: await StorageConditionsModel.fromEntity(entity.conditions),
  );
}