flutter-web

How to specify a port number while running flutter web


Is there any way to start Flutter web, with a Headless-Server target, always on the same specified port number ?

Today, running the web application with:

flutter run -d headless-server

Provides a random port number.


Solution

  • I found the answer inside the flutter_tools source code:

    flutter run -d headless-server --web-port=1234