toJson method
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'type': type.name,
if (title != null) 'title': title,
if (config.isNotEmpty) 'config': config,
if (children.isNotEmpty)
'children': children.map((c) => c.toJson()).toList(),
if (flex != 1) 'flex': flex,
};