How to run Flutter web with a custom port

Updated: March 31, 2023 By: A Goodman Post a comment

By default, each time you start Flutter web on localhost, it will have a different port. However, there are cases where you need to set up a fixed, unchanged port (like when you want to implement social auth with Google Sign-In). To do that, use the –web-port flag when running your project like so:

flutter run -d chrome --web-port=10000

Screenshot:

That’s it. Further reading:

You can also take a tour around our Flutter topic page and Dart topic page to see the latest tutorials and examples.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Related Articles