Home > Enterprise >  Flutter Get Not retrieving data in console
Flutter Get Not retrieving data in console

Time:08-15

enter image description here

Please check the image for the issue, every instance has been called but no data is being shown, and I also have put the code in the View Page, so it should show it on the mobile, please let me know if you need anything from me!

Thanks, Mohsin

CodePudding user response:

The error is with your interceptor function

change the function to this

_dio.interceptors.add(
      InterceptorsWrapper(
        one rror: (error, handler) {
          print(error.message);
          handler.next(error);
        },
        onRequest: ((request, handler) {
          print(
            "${request.method} | ${request.path}",
          );
          handler.next(request);
        }),
        onResponse: (response, handler) {
          print(
              "${response.statusCode} ${response.statusMessage} ${response.data}");
          handler.next(response);
        },
      ),
    );
  • Related