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({
      'image': this.image,
      'width': this.width,
      'height': this.height,
      'anchorX': this.anchorX,
      'anchorY': this.anchorY,
      'zoomLevel': this.zoomLevel,
      'position': this.position?.toMap(),
      'bounds': this.bounds?.toMap(),
      'transparency': this.transparency,
    });
}