getErrorCode property
Function to extract the error code from the API response.
Implementation
GetValueFromResponse<MapEntry<String, dynamic>?>? getErrorCode =
(dynamic response, {String? url, int? httpCode}) {
if (response is Map) {
if (response["errorCode"] == null) return null;
return MapEntry("errorCode", response["errorCode"]);
}
if (![200, 201].contains(httpCode) && httpCode != null) {
return MapEntry("errorCode", httpCode.toString()) ;
}
return null;
};