Map<String, Object?> toJson() { final type = this.type; return { if (type != null) 'type': type, }; }