toJson method
Converts a EventSource instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempComponent = component;
final tempHost = host;
if (tempComponent != null) {
jsonData['component'] = tempComponent;
}
if (tempHost != null) {
jsonData['host'] = tempHost;
}
return jsonData;
}