fromMap static method

GridViewEntity? fromMap(
  1. Object? o, {
  2. Map<String, String>? newDocumentIds,
})

Implementation

static GridViewEntity? fromMap(Object? o,
    {Map<String, String>? newDocumentIds}) {
  if (o == null) return null;
  var map = o as Map<String, dynamic>;

  var conditionsFromMap = map['conditions'];
  if (conditionsFromMap != null) {
    conditionsFromMap = StorageConditionsEntity.fromMap(conditionsFromMap,
        newDocumentIds: newDocumentIds);
  }

  return GridViewEntity(
    appId: map['appId'],
    name: map['name'],
    scrollDirection: map['scrollDirection'],
    type: map['type'],
    crossAxisCount: int.tryParse(map['crossAxisCount'].toString()),
    maxCrossAxisExtentType: map['maxCrossAxisExtentType'],
    absoluteMaxCrossAxisExtent:
        double.tryParse(map['absoluteMaxCrossAxisExtent'].toString()),
    relativeMaxCrossAxisExtent:
        double.tryParse(map['relativeMaxCrossAxisExtent'].toString()),
    childAspectRatio: double.tryParse(map['childAspectRatio'].toString()),
    padding: double.tryParse(map['padding'].toString()),
    mainAxisSpacing: double.tryParse(map['mainAxisSpacing'].toString()),
    crossAxisSpacing: double.tryParse(map['crossAxisSpacing'].toString()),
    conditions: conditionsFromMap,
  );
}