Change the default IP(127.0.0.1) of flutter web App.
I have created a flutter web application, when I run the web app the ip which assigned is 127.0.0.1 but i am unable to access the same app with my local IP over LAN. So please help on how can i change this.
You can add this command line parameter
--web-hostname 0.0.0.0
.
( --hostname
doesn't work now. )
So when you start your web server you would start like this :
flutter run -d chrome --web-hostname 0.0.0.0 --web-port 55555
This will allow you to access your web app from any device in your LAN network by accessing the url :
http://your-local-ip:55555
update
webdev
is no longer used for launching flutter web
applications. Now use:
flutter run -d web-server --web-hostname 0.0.0.0 --web-port 8989
original answer
Start the app with command:
webdev server --web-hostname 0.0.0.0
Or replace 0.0.0.0 with your actual ip address.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With