Map<String, dynamic> toJson() { final data = this.data; final fileName = this.fileName; return { if (data != null) 'data': base64Encode(data), if (fileName != null) 'fileName': fileName, }; }