Dart/Flutter
Introduction
https://en.wikipedia.org/wiki/Dart_(programming_language) is a language created by Google to replace Javascript. It is targetting a VM (DartVM).
https://en.wikipedia.org/wiki/Flutter_(software) is a framework to create native, web, or mobile apps (from the same code) written in Dart.
Status
Dart: It’s supported for Windows on Arm for Dev Channel and latest binaries are available here (or on this page: Dart SDK archive ).
Flutter: Build from source works, and flutter engine binaries are available. Compile natively flutter app is now supported (Enable native compilation for windows-arm64 by pbo-linaro · Pull Request #141930 · flutter/flutter ). Cross compilation is not upstream, but you can use this PR if you’re interested: Enable cross compilation for windows-arm64 by pbo-linaro · Pull Request #142431 · flutter/flutter.
See this design document for details: https://docs.google.com/document/d/1yuexY-EtzeVhU3V6RGBII_kH-znLSkQCspzW70jayZk/edit?resourcekey=0-8pQRSXSHQlwOo7QtCVLvBA and open issues [Windows] ☂️ Add support for Arm64 as a target · Issue #62597 · flutter/flutter.
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.
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: Enable cross compilation for windows-arm64 by pbo-linaro · Pull Request #142431 · flutter/flutter
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 (gn - Git at Google , a cmake like, and depot_tools_tutorial(7) ). Both projects provide wrappers to build, without the need to call gn
directly.
get visual studio components
you need to install ATL libraries for your visual studio version.
get windows sdk debuggers
you need to install debuggers from Windows SDK - Windows app development . Dart/Flutter build search for dbgcore.dll and dbghelp.dll.
get python3
python3.exe
should be available on the PATH. arm64 version should be installed as it is used by depot_tools to identify cpu architecture.
When installing python on windows, only python.exe
is available. You need to copy it (duplicate it) as python3.exe
.
get depot_tools
First, you need to retrieve depot_tools from this URL, and unzip it
Then, add following directories to your PATH:
# contains ninja.exe and other binaries for windows
depot_tools/.cipd_bin
# main scripts (fetch, gsync, ...)
depot_tools/
set environment
# 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
Build
Test
Run
Create file named hw.dart with this content:
You can run it using:
Flutter
Note: Flutter artifacts are now built upstream, and it’s not needed to build this manually.
Clone
Build engine
CI
Flutter uses GitHub Actions Workflow runs · flutter/flutter
Binary availability
Flutter (prebuilt) binaries are automatically downloaded first time flutter
command is run. Based on current cpu architecture, it will download native windows-x64 or windows-arm64 binaries.