fromMap static method
Implementation
static Building fromMap(dynamic buildingMap) {
var list = buildingMap['levels'] as List<dynamic>;
var levelsList = list.map((e) => Level.fromMap(e)).toList();
return Building(
id: buildingMap['id'] as int?,
name: buildingMap['name'] as String,
levels: levelsList,
defaultLevelId: buildingMap['defaultLevelId'] as double?,
activeLevel: Level.fromMap(buildingMap['activeLevel']),
defaultLevel: Level.fromMap(buildingMap['defaultLevel']),
defaultLevelIndex: buildingMap['defaultLevelIndex'] as int,
activeLevelIndex: buildingMap['activeLevelIndex'] as int,
boundingBox: Map.from(buildingMap).containsKey('boundingBox')
? BBoxExtension.fromMap(buildingMap['boundingBox'])
: null,
);
}