...
Flutter: Build from source works, and flutter engine binaries are available. Building flutter apps is a work in progress. Compile natively flutter app is now supported (https://github.com/flutter/flutter/pull/141930 ). Cross compilation is not upstream, but you can use this PR if you’re interested: https://github.com/flutter/flutter/pull/142431.
See this design document for details: https://docs.google.com/document/d/1yuexY-EtzeVhU3V6RGBII_kH-znLSkQCspzW70jayZk/edit?resourcekey=0-8pQRSXSHQlwOo7QtCVLvBA and open issues https://github.com/flutter/flutter/issues/62597 . WIP.
Flutter App
Since Dart and Flutter engine are now built upstream, we document how to simply create, build and run a flutter App.
If you’re interested in manually building dart or flutter itself, you can follow other instructions on this page.
Code Block |
---|
git clone https://github.com/flutter/flutter
flutter/bin/flutter.bat create app
cd app
../flutter/bin/flutter.bat build windows
file build/windows/arm64/runner/Release/app.exe
# on windows-x64, it will build an x64 app instead |
If you’re interested in cross compilation, take a look at this PR: https://github.com/flutter/flutter/pull/137618/142431
Setup (common to both projects)
Note: This is needed only if you intend to build dart and flutter manually. Upstream artifacts are now available for windows-arm64, so there is no need to build this manually.
Those two projects are built using chromium build system (https://gn.googlesource.com/gn/ , a cmake like, and https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up ). Both projects provide wrappers to build, without the need to call gn
directly.
...
Code Block |
---|
# force to get local toolchain (needed when you're not a Google employee) set DEPOT_TOOLS_WIN_TOOLCHAIN=0 |
Dart
Note: Dart artifacts are now built upstream, and it’s not needed to build this manually.
Clone
Code Block |
---|
fetch dart cd sdk |
...
Code Block |
---|
# execute directly out/ReleaseXARM64/dart.exe run hw.dart # compile it to bytecode out/ReleaseXARM64/dart.exe compile kernel hw.dart -o hw.dill # run from bytecode out/ReleaseXARM64/dart.exe run hw.dill |
Flutter
Note: Flutter artifacts are now built upstream, and it’s not needed to build this manually.
Clone
Code Block |
---|
fetch flutter cd src |
...
Code Block |
---|
set GYP_MSVS_OVERRIDE_PATH='C:\Program Files (x86)\Microsoft Visual Studio\2019\Community' # --no-goma: is google distributed build system (only for Googlers) python3 ./flutter/tools/gn --no-goma --windows-cpu arm64 --target-dir host_debug ninja -C out/host_debug |
Build example app (gallery)
...
CI
Flutter uses GitHub Actions https://github.com/flutter/flutter/actions
...