When I run:
$ flutter build web
I'm getting the error
Missing index.html.
The flutter app is displaying in the browser, but in VS Code it reads "No Device." How can I debug, or fix this problem?
Flutter actually controls every pixel that is drawn to the screen and doesn't use HTML, JavaScript, or CSS to define any of its look or logic. (Technically speaking, native Dart code is transpiled to JavaScript through dart2js , but no business logic is actually written in JavaScript.)
You must use the channel master for flutter in order to build web version, more details here. After that, just run flutter build web and then, go in root_of_your_app/build/web and run a web server inside like python with python -m http. server 8000 and go to http://localhost:8000 to see your app on any browsers.
It would help to see the output of your flutter doctor, but I am guessing that your project is not configured for web.
If you haven't already, you need to switch to the flutter beta channel like so:
$ flutter channel beta $ flutter upgrade $ flutter config --enable-web
At this point, running flutter doctor
should show that chrome is available.
Then, switch into your application root directory, and run
$ flutter create .
This will rebuild the project to support web.
Then, from the same directory, you can run flutter build web
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