The connection errored: Connection refused This indicates an error which most likely cannot be solved by the library

42 views Asked by At
@override
  Future<UserEntity?> getCurrentUser() async {
    UserEntity? user ;

    try {
      final firebaseUser = _auth.currentUser;
      var url = '/user/find';
      var parameters = {'email': firebaseUser!.email};
      var response = await dio.get(url, queryParameters: parameters);

      user = UserEntity.fromJson(response.data);
    } catch (e) {
      print(e.toString());
    }
    return user;
}

I have this method to get current user from my backend. But suddenly one day it stopped working and I got this error. The requests to the API work because from postman I have results. I'm working in localhost.

I tried to change the URL to my local ip, but nothing.

0

There are 0 answers