text
stringlengths
1
474
flow-based content. For example, blog articles benefit from the document-centric
model that the web is built around, rather than the app-centric services that a
UI framework like Flutter can deliver. However, you can use Flutter to embed
interactive experiences into these websites.For more information on how you can use Flutter on the web,
see Web support for Flutter.<topic_end>
<topic_start>
Search Engine Optimization (SEO)
In general, Flutter is geared towards dynamic application experiences. Flutter’s
web support is no exception. Flutter web prioritizes performance, fidelity, and
consistency. This means application output does not align with what search
engines need to properly index. For web content that is static or document-like,
we recommend using HTML—just like we do on flutter.dev,
dart.dev, and pub.dev. You should also
consider separating your primary application experience—created in Flutter—from
your landing page, marketing content, and help content—created using
search-engine optimized HTML.<topic_end>
<topic_start>
How do I create an app that also runs on the web?
See building a web app with Flutter.<topic_end>
<topic_start>
Does hot reload work with a web app?
No, but you can use hot restart. Hot restart is a fast way of seeing your
changes without having to relaunch your web app and wait for it to compile and
load. This works similarly to the hot reload feature for Flutter mobile
development. The only difference is that hot reload remembers your state and hot
restart doesn’t.<topic_end>
<topic_start>
How do I restart the app running in the browser?
You can either use the browser’s refresh button,
or you can enter “R” in the console where
“flutter run -d chrome” is running.<topic_end>
<topic_start>
Which web browsers are supported by Flutter?
Flutter web apps can run on the following browsers:During development, Chrome (on macOS, Windows, and Linux) and Edge (on Windows)
are supported as the default browsers for debugging your app.<topic_end>
<topic_start>
Can I build, run, and deploy web apps in any of the IDEs?
You can select Chrome or Edge as the target device in
Android Studio/IntelliJ and VS Code.The device pulldown should now include the Chrome (web)
option for all channels.<topic_end>
<topic_start>
How do I build a responsive app for the web?
See Creating responsive apps.<topic_end>
<topic_start>
Can I use dart:io with a web app?
No. The file system is not accessible from the browser.
For network functionality, use the http
package. Note that security works somewhat
differently because the browser (and not the app)
controls the headers on an HTTP request.<topic_end>
<topic_start>
How do I handle web-specific imports?
Some plugins require platform-specific imports, particularly if they use the
file system, which is not accessible from the browser. To use these plugins
in your app, see the documentation for conditional imports
on dart.dev.<topic_end>
<topic_start>
Does Flutter web support concurrency?
Dart’s concurrency support via isolates
is not currently supported in Flutter web.Flutter web apps can potentially work around this
by using web workers,
although no such support is built in.<topic_end>
<topic_start>
How do I embed a Flutter web app in a web page?
You can embed a Flutter web app,
as you would embed other content,
in an iframe tag of an HTML file.
In the following example, replace “URL”
with the location of your hosted HTML page:If you encounter problems, please file an issue.<topic_end>
<topic_start>
How do I debug a web app?
Use Flutter DevTools for the following tasks:Use Chrome DevTools for the following tasks:<topic_end>
<topic_start>
How do I test a web app?
Use widget tests or integration tests. To learn more about
running integration tests in a browser, see the Integration testing page.<topic_end>
<topic_start>
How do I deploy a web app?
See Preparing a web app for release.<topic_end>
<topic_start>
Does Platform.is work on the web?
Not currently.
<topic_end>
<topic_start>Web renderers
When running and building apps for the web, you can choose between two different
renderers. This page describes both renderers and how to choose the best one for
your needs. The two renderers are:<topic_end>
<topic_start>
Command line options
The --web-renderer command line option takes one of three values, auto,
html, or canvaskit.This flag can be used with the run or build subcommands. For example:This flag is ignored when a non-browser (mobile or desktop) device
target is selected.<topic_end>
<topic_start>
Runtime configuration
To override the web renderer at runtime:The web renderer can’t be changed after the Flutter engine startup process
begins in main.dart.js.info Note
As of Flutter 3.7.0, setting a window.flutterWebRenderer
(an approach used in previous releases) displays a
deprecation notice in the JS console. For more information,
check out Customizing web app initialization.<topic_end>