0

So I'm developing a Flutter project that interact with PostgreSQL Database with Dart and I have a problem with the connection between PostgreSQL and Flutter.

Any ideas why I'm getting this kind of error: this is the code and the error that i get

1
  • The most likely reason is that the firewall on 10.0.0.2 is blocking inbound connections or the postgres server is only listening on localhost. As an aside about your Flutter code, you obviously must not perform any database operations in build as they all take time to finish and build must not wait for anything. When calling connection.open() you should await the result, which means you need to do that somewhere you can make async. This is one of the topics about Flutter that confuses some people initially, but since it is so fundamental there's lots of good articles about it. Commented Jan 22, 2022 at 12:26

1 Answer 1

1

So thankfully I found the error. I was pointing at 10.0.0.2, but I had to put 10.0.2.2.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.