toJson method
Converts the Event object to a JSON map.
This method is typically used internally by the json_serializable package.
Null values are automatically removed from the final JSON output.
Implementation
Map<String, dynamic> toJson() {
final json = _$EventToJson(this);
// Remove null values before sending
json.removeWhere((key, value) => value == null);
return json;
}