ErrorMessageResponse.fromMap constructor
ErrorMessageResponse.fromMap(
- Map<String, dynamic>? map
)
Implementation
factory ErrorMessageResponse.fromMap(Map<String, dynamic>? map) {
var errors = <String>[];
if (map?['error'] != null) {
map?['error'].forEach((v) {
errors.add(v);
});
}
return ErrorMessageResponse(
message: map?['message'] as String? ??
map?['msg'] as String? ??
map?['operationMessage'] as String? ??
map?['error_description'] as String? ??
map?['errorCode'] ??
"somethingWentWrong",
errors: errors,
);
}