How to fix 'SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.5.10, port = 49590' error in flutter How to fix 'SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.5.10, port = 49590' error in flutter dart dart

How to fix 'SocketException: OS Error: Connection timed out, errno = 110, address = 192.168.5.10, port = 49590' error in flutter


I used http package in flutter. And got the same error as yours. My solution is 'I used ngrok to expose my localhost' then I change my url to the url that ngrok forward.-Note: Use ngrok to test the api only. And when we host the to the server, there will not be any problems related to response time so you can use your server ip.