toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'layout': layout ?? '',
'urlImage': urlImage ?? '',
'contents': contents != null && contents!.isNotEmpty
? contents!.map((content) => content.toJson()).toList()
: []
};
}