onResponse method

  1. @override
Future onResponse(
  1. Response response
)
override

The callback will be executed on success.

If you want to reject the request with a error message, you can return a DioError object or return dio.reject . If you want to continue the request, return the Response object.

Implementation

@override
Future onResponse(Response response) async {
  if (_onResponse != null) {
    return _onResponse!(response);
  }
}