toJson method

Map<String, dynamic> toJson()

Implementation

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