I am developing an app in flutter that connects to a PostgreSQL server in a raspberry pi. Everything works fine in debug mode but when I switch to release mode, I get this error message:
PostgreSQLSeverity.error : Attempting to execute query, but connection is not open.
Here is the connection code for helping with the solution:
static PostgreSQLConnection openConnection(){
var connection = PostgreSQLConnection(ip, port, dbName, username: 'xxxxxxxxx', password: 'xxxxxxxx');
connection.open();
return connection;
}
I don't know where to start looking for an error or something. Any idea about how to deal with this issue?
Thanks.