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