Is there any way to set the port of Chrom when running "flutter run -d chrome"? Without it my localStorage is lost on every run due to the new port/origin.
Or is there another way to keep localStorage across different ports
I also faced the same problem. so, I looked for sources related to the flutter run command and found the web options for the command.
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/runner/flutter_command.dart#L137
You can set any port using the --web-port
option.
flutter run -d chrome --web-port 8080
you can using any below command to launch flutter web app:
flutter run -d chrome --web-port 8080
flutter run -d edge --web-port 8080
flutter run -d web-server --web-port 8080
also you can add the additional parameters to the run configuration as this:
add `--web-port=8080` to `Additional arguments` in run configuration into toolbar.
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