toMap method Null safety

  1. @override
Map<String, Object?> toMap()
override

model -> map

Implementation

@override
Map<String, Object?> toMap() {
  return Map.from(super.toMap())
    ..addAll({
      'coordinates': this.coordinates?.map((coord) => coord.toMap()).toList(),
      'buildInfo': this.buildInfo?.toMap(),
      'height': this.height,
      'topFaceColor': this.topFaceColor?.value.toRadixString(16),
      'sideFaceColor': this.sideFaceColor?.value.toRadixString(16),
      'sideFacTexture': this.sideFacTexture,
      'isGrowthAnimation': this.isGrowthAnimation,
      'showLevel': this.showLevel,
    });
}