fromEntity static method
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),
);
}