toMap method
Return a map representation of this error suitable for conversion to json.
Implementation
Map<String, dynamic> toMap() {
Map<String, dynamic> map = {
'code': code,
'message': message,
};
if (data != null) {
map['data'] = data;
}
return map;
}