text
stringlengths
1
474
To update the icon of a Flutter Windows
desktop application before packaging use the
following instructions:When packaging with the msix pub package,
the logo path can also be configured inside the pubspec.yaml file.To update the application image in the Store listing,
navigate to the Store listing step of the submission
and select Store logos.
From there, you can upload the logo with
the size of 300 x 300 pixels.All uploaded images are retained for subsequent submissions.<topic_end>
<topic_start>
Validating the application package
Before publication to the Microsoft Store,
first validate the application package locally.Windows App Certification Kit
is a tool included in the
Windows Software Development Kit (SDK).To validate the application:The report might contain important warnings and information,
even if the certification passes.
<topic_end>
<topic_start>Build and release a web app
During a typical development cycle,
you test an app using flutter run -d chrome
(for example) at the command line.
This builds a debug version of your app.This page helps you prepare a release version
of your app and covers the following topics:<topic_end>
<topic_start>
Building the app for release
Build the app for deployment using the
flutter build web command.
You can also choose which renderer to use
by using the --web-renderer option (See Web renderers).
This generates the app, including the assets,
and places the files into the /build/web
directory of the project.The release build of a simple app has the
following structure:info Note
The canvaskit directory and its contents are only present when the
CanvasKit renderer is selected—not when the HTML renderer is selected.Launch a web server (for example,
python -m http.server 8000,
or by using the dhttpd package),
and open the /build/web directory. Navigate to
localhost:8000 in your browser
(given the python SimpleHTTPServer example)
to view the release version of your app.<topic_end>
<topic_start>
Deploying to the web
When you are ready to deploy your app,
upload the release bundle
to Firebase, the cloud, or a similar service.
Here are a few possibilities, but there are
many others:<topic_end>
<topic_start>
Deploying to Firebase Hosting
You can use the Firebase CLI to build and release your Flutter app with Firebase
Hosting.<topic_end>
<topic_start>
Before you begin
To get started, install or update the Firebase CLI:<topic_end>
<topic_start>
Initialize Firebase
Enable the web frameworks preview to the Firebase framework-aware CLI:In an empty directory or an existing Flutter project, run the initialization
command:Answer yes when asked if you want to use a web framework.If you’re in an empty directory,
you’ll be asked to choose your web framework. Choose Flutter Web.Choose your hosting source directory; this could be an existing flutter app.Select a region to host your files.Choose whether to set up automatic builds and deploys with GitHub.Deploy the app to Firebase Hosting:Running this command automatically runs flutter build web --release,
so you don’t have to build your app in a separate step.To learn more, visit the official Firebase Hosting documentation for
Flutter on the web.<topic_end>
<topic_start>
Handling images on the web
The web supports the standard Image widget to display images.
By design, web browsers run untrusted code without harming the host computer.
This limits what you can do with images compared to mobile and desktop platforms.For more information, see Displaying images on the web.<topic_end>
<topic_start>
Choosing a web renderer
By default, the flutter build and flutter run commands
use the auto choice for the web renderer. This means that
your app runs with the HTML renderer on mobile browsers and
CanvasKit on desktop browsers. We recommend this combination
to optimize for the characteristics of each platform.For more information, see Web renderers.<topic_end>
<topic_start>
Minification
Minification is handled for you when you
create a release build.<topic_end>
<topic_start>
Embedding a Flutter app into an HTML page
<topic_end>
<topic_start>
hostElement
Added in Flutter 3.10
You can embed a Flutter web app into
any HTML element of your web page, with flutter.js and the hostElement
engine initialization parameter.To tell Flutter web in which element to render, use the hostElement parameter of the initializeEngine
function:To learn more, check out Customizing web app initialization.<topic_end>
<topic_start>
Iframe
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 HTML page:<topic_end>
<topic_start>
PWA Support
As of release 1.20, the Flutter template for web apps includes support
for the core features needed for an installable, offline-capable PWA app.
Flutter-based PWAs can be installed in the same way as any other web-based
PWA; the settings signaling that your Flutter app is a PWA are provided by