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