1

I am unable to launch a Flutter (Chrome) web app on a public WiFi (train, plane, library, coffee shop, etc).

Can you flutter run on a public WiFi?

Sam
  • 563
  • 5
  • 15

3 Answers3

0

try to open with the IP address of the wifi on laptop

ex: http://123.456.78.90:(port number given by Flutter)

or use ngrok and access like above

dfassf
  • 142
  • 10
  • Strange.. but I cannot quite tell whether the answer you give is a serious one. Could you elaborate? – Sam Jan 28 '23 at 23:24
  • or I misunderstood the question probably. I thought you were asking about the way to access localhost remotely if it is not, adding in AndroidManifext.xml can be a solution too – dfassf Jan 29 '23 at 10:39
0

As of

Flutter 3.7.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 90c64ed42b (6 days ago) • 2023-03-21 11:27:08 -0500
Engine • revision 9aa7816315
Tools • Dart 2.19.5 • DevTools 2.20.1

this ceased to be an issue. I can flutter run on a public WiFi.

Update

Now at

[✓] Flutter (Channel stable, 3.7.10,
on macOS 11.7.4 20G1120 darwin-x64, locale en-CA)

it's again a problem, with the error

SocketException: Failed host lookup: 'localhost'
(OS Error: nodename nor servname provided,
or not known, errno = 8)

hence the question is once again open.

See also...

Use your IP

The following may work for you

flutter run -d chrome --web-port=8080 --web-hostname=101.112.123.1349

where the four numbers are your IP.

Other pointers

Sam
  • 563
  • 5
  • 15
-1

Try to use your IP's machine, if you don't know, you can try opening a cmd terminal in windows and type ipconfig and get your local IP. Or terminal in linux/mac type ifconfig and find your local IP

  • Yes, this seems to work for some people, but not for me. See the updated answer. – Sam Apr 12 '23 at 23:20