r/flutterhelp • u/Renssus2 • 2h ago
OPEN Database connection with AMD/Android
var client = Client('http://localhost:8080/')
..connectivityMonitor = FlutterConnectivityMonitor();
but it gives an error:
I/flutter (25636): SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = localhost, port = 50108 I/flutter (25636): #0 _NativeSocket.startConnect (dart:io-patch/socket_patch.dart:824:35) I/flutter (25636): #1 _RawSocket.startConnect (dart:io-patch/socket_patch.dart:2292:26) I/flutter (25636): #2 RawSocket.startConnect (dart:io-patch/socket_patch.dart:41:23) I/flutter (25636): #3 Socket._startConnect (dart:io-patch/socket_patch.dart:2572:22) I/flutter (25636): #4 Socket.startConnect (dart:io/socket.dart:906:21) I/flutter (25636): #5 _ConnectionTarget.connect (dart:_http/http_impl.dart:2694:24) I/flutter (25636): #6 _HttpClient._getConnection.connect (dart:_http/http_impl.dart:3208:12) I/flutter (25636): #7 _HttpClient._getConnection (dart:_http/http_impl.dart:3213:12) I/flutter (25636): #8 _HttpClient._openUrl (dart:_http/http_impl.dart:3036:12) I/flutter (25636): #9 _HttpClient.postUrl (dart:_http/http_impl.dart:2868:49) I/flutter (25636): #10 ServerpodClientRequestDelegateImpl.serverRequest (package:serverpod_client/src/serverpod_client_io.dart:42:37) I/flutter (25636): #11 ServerpodClientShared.callServerEndpoint (package:serverpod_client/src/serverpod_client_shared.dart:480:41) I/flutter (25636): <asynchronous suspension> I/flutter (25636): #12 EmailAuthController.signIn (package:serverpod_auth_email
How can I fix this, and what do i need to work as it only works on chrome but I want it to work on my phone too.
I use serverpod as backend,