toJson method
Implementation
Map<String, Object?> toJson() {
final data = <String, Object?>{};
if (summary != null) {
data['summary'] = summary!.toJson();
}
if (state != null) {
data['state'] = {
'events': state!.map((i) => i.toJson()).toList(),
};
}
if (timeline != null) {
data['timeline'] = timeline!.toJson();
}
if (ephemeral != null) {
data['ephemeral'] = {
'events': ephemeral!.map((i) => i.toJson()).toList(),
};
}
if (accountData != null) {
data['account_data'] = {
'events': accountData!.map((i) => i.toJson()).toList(),
};
}
if (unreadNotifications != null) {
data['unread_notifications'] = unreadNotifications!.toJson();
}
return data;
}