toJson method

Map<String, dynamic> toJson()

Converts this WidgetData to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    if (title != null) 'title': title,
    if (subtitle != null) 'subtitle': subtitle,
    if (body != null) 'body': body,
    if (imageUrl != null) 'imageUrl': imageUrl,
    if (iconName != null) 'iconName': iconName,
    if (customData != null) 'customData': customData,
    if (timestamp != null) 'timestamp': timestamp!.toIso8601String(),
  };
}