toMap method Null safety

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

Implementation

@override
Map<String, Object?> toMap() {
  return {
    'id': this.id,
    'text': this.text,
    'position': this.position.toMap(),
    "bgColor": this.bgColor?.value.toRadixString(16),
    "fontColor": this.fontColor?.value.toRadixString(16),
    "fontSize": this.fontSize,
    "typeFace": this.typeFace?.toMap(),
    "alignX": this.alignX,
    "alignY": this.alignY,
    "rotate": this.rotate,
    "zIndex": this.zIndex,
    'visible': this.visible,
  };
}