I am building a flutter web app, but I want it to behave differently on mobile and desktop. To test it, is it possible to run the web app on a phone's browser or in the browser of an emulator? Thanks
Yes, testing your code in a web browser while in production is possible. Here are steps to do that:
t
flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0
Then, head to your mobile phone browser and type
HTTP://<your PC IP address>:8080
You need to start your flutter web-app on a specific port
flutter run -d web-server --web-port 5011
Connect your device and verify if the device is connected properly
adb devices
adb port-forwarding
adb reverse tcp:5011 tcp:5011
Open Mobile Browser with http://localhost:5011/
after that, you can able to access that port on a mobile browser.
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