toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> map = {};
  if (thumbnail != null) {
    map['thumbnail'] = thumbnail!.toJson();
  }
  if (hero != null) {
    map['hero'] = hero!.toJson();
  }
  if (backgroundColor != null) {
    map['background'] = {'color': backgroundColor};
  }
  if (textColor != null) {
    map['text'] = {'color': textColor};
  }
  return map;
}