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.
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.
buildas they all take time to finish andbuildmust not wait for anything. When callingconnection.open()you shouldawaitthe result, which means you need to do that somewhere you can makeasync. 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.