toMap method
Converts the SunmiTextStyle object to a map for serialization or transfer.
The resulting map contains:
- 'fontSize': The size of the text.
- 'align': The alignment of the text (string representation).
- 'bold': Whether the text is bold.
- 'underline': Whether the text has an underline.
- 'strikethrough': Whether the text has a strikethrough.
- 'italic': Whether the text is italicized.
- 'reverse': Whether the text is printed in reverse mode.
Implementation
Map<String, dynamic> toMap() {
return <String, dynamic>{
'fontSize': fontSize, // The size of the text.
'align': align?.name, // The alignment of the text.
'bold': bold, // Whether the text is bold.
'underline': underline, // Whether the text has an underline.
'strikethrough': strikethrough, // Whether the text has a strikethrough.
'italic': italic, // Whether the text is italicized.
'reverse': reverse, // Whether the text is in reverse mode.
};
}