toJson method
Serializes the rich text widget into a JSON-compatible map, useful for dynamic rendering or API output.
Implementation
@override
Map<String, dynamic> toJson() => {
'type': 'rich_text',
'children': children.map((child) => child.toJson()).toList(),
'align': align.name,
};