toJson method
Render to intermediate JSON (for APIs, mobile apps, etc.)
Implementation
@override
Map<String, dynamic> toJson() => {
'type': 'box',
'children': children.map((child) => child.toJson()).toList(),
'constraints': constraints?.toJson(),
'padding': padding?.toJson(),
'margin': margin?.toJson(),
'backgroundColor': backgroundColor,
'border': border?.toJson(),
'borderRadius': borderRadius?.toJson(),
'shadow': shadow?.toJson(),
'alignment': alignment.name,
'decoration': decoration?.toJson(),
};