text stringlengths 1 372 |
|---|
other resources |
to learn more about c interoperability, check out these videos: |
<topic_end> |
<topic_start> |
web support for flutter |
flutter’s web support delivers the same experiences on the web as on mobile. |
building on the portability of dart, the power of the web platform and the |
flexibility of the flutter framework, you can now build apps for iOS, android, |
and the browser from the same codebase. you can compile existing flutter code |
written in dart into a web experience because it is exactly the same flutter |
framework and web is just another device target for your app. |
adding web support to flutter involved implementing flutter’s |
core drawing layer on top of standard browser APIs, in addition |
to compiling dart to JavaScript, instead of the ARM machine code that |
is used for mobile applications. using a combination of DOM, canvas, |
and WebAssembly, flutter can provide a portable, high-quality, |
and performant user experience across modern browsers. |
we implemented the core drawing layer completely in dart |
and used dart’s optimized JavaScript compiler to compile the |
flutter core and framework along with your application |
into a single, minified source file that can be deployed to |
any web server. |
while you can do a lot on the web, |
flutter’s web support is most valuable in the |
following scenarios: |
not every HTML scenario is ideally suited for flutter at this time. |
for example, text-rich, flow-based, static content such as 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 a glimpse into how to migrate your mobile app to web, see |
the following video: |
<topic_end> |
<topic_start> |
resources |
the following resources can help you get started: |
<topic_end> |
<topic_start> |
add web devtools for flutter |
to choose the guide to add web devtools to your flutter configuration, |
click the getting started path you followed. |
<topic_end> |
<topic_start> |
building a web application with flutter |
this page covers the following steps for getting started with web support: |
<topic_end> |
<topic_start> |
requirements |
to create a flutter app with web support, |
you need the following software: |
for more information, see the web FAQ. |
<topic_end> |
<topic_start> |
create a new project with web support |
you can use the following steps |
to create a new project with web support. |
<topic_end> |
<topic_start> |
set up |
run the following commands to use the latest version of the flutter SDK: |
warning warning |
running flutter channel stable replaces your current version of flutter |
with the stable version and can take time if your connection is slow. |
after this, running flutter upgrade upgrades your install to the latest |
stable. returning to another channel (beta or master) requires calling |
flutter channel <channel> explicitly. |
if chrome is installed, |
the flutter devices command outputs a chrome device |
that opens the chrome browser with your app running, |
and a web server that provides the URL serving the app. |
in your IDE, you should see chrome (web) in the device pulldown. |
<topic_end> |
<topic_start> |
create and run |
creating a new project with web support is no different |
than creating a new flutter project for other platforms. |
<topic_end> |
<topic_start> |
IDE |
create a new app in your IDE and it automatically |
creates iOS, android, desktop, and web versions of your app. |
from the device pulldown, select chrome (web) |
and run your app to see it launch in chrome. |
<topic_end> |
<topic_start> |
command line |
to create a new app that includes web support |
(in addition to mobile support), run the following commands, |
substituting my_app with the name of your project: |
to serve your app from localhost in chrome, |
enter the following from the top of the package: |
info note |
if there aren’t any other connected devices, |
the -d chrome is optional. |
the flutter run command launches the application using the |
development compiler in a chrome browser. |
warning warning |
hot reload is not supported in a web browser |
currently, flutter supports hot restart, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.