toMap method

  1. @override
Map toMap()
override

Converts this transform object to a Map.

Returns a Map representing the properties of this layer object, including the X and Y coordinates, rotation angle, scale factors, and flip flags.

Implementation

@override
Map toMap() {
  return {
    ...super.toMap(),
    'text': text,
    'colorMode': LayerBackgroundMode.values[colorMode?.index ?? 0].name,
    'color': color.value,
    'background': background.value,
    'colorPickerPosition': colorPickerPosition ?? 0,
    'align': align.name,
    'fontScale': fontScale,
    'type': 'text',
    'fontFamily': textStyle?.fontFamily
  };
}