Why --web-port=8080?
Flutter randomly assigns port numbers at runtime.
There are a few limitations in Flutter for Web platforms that hinder the app from listening to callbacks. Hence, the app manually retrieves the callback response from the redirect URI.
How?
This is done by making the page at redirect_uri to redirect to the localhost app manually. The port number must be known by the page for it to redirect. Specifying a specific port stops the randomization of these port numbers, allowing the page to redirect correctly.
Last updated