While the Flutter SDK has been broaden to include other platforms including web, macOS, and Linux; now, the alpha release of Flutter for Windows has been announced. As Windows remains a popular desktop choice, with over one billion active devices running Windows 10, it’s a natural target for Flutter.
Flutter for Windows Alpha can build standard .exe files and the supporting libraries, to run on PCs as dated as Windows 7, all the way up to Windows 10. And just like Flutter on other platforms, you can make use of the exact Dart code for Android/iOS app for Windows and other supported desktop platforms.
What the Flutter SDK will bring to the Windows platform
Flutter expands the core framework of each platform it is added on with new services to enable it to shine on that platform.
Furthermore, the new platform doesn’t only influence the Flutter framework and engine, but several other things as well, including:
- Plugins: Mixture of Dart code and native code available for each of the platforms which the plugin supports. And the native code has to be added for each plugin compiled into Flutter app.
- Toolchain updates: It adds a new target to the CLI and IDE tools, which in this case, on Windows platform.
- Shell: The support for handling input from Windows via WM_* messages and output via ANGLE, uses Skia to render at native speed for underlying DirectX surface.
Additionally, every new project gets a shell application for the supported targets, like on Windows, there is a Win32/C++ program that loads Flutter code and executes it at runtime, which is a good place to add native code to your app if needed.
How to Get Started with Flutter for Windows
The Flutter SDK can be installed according to the Windows installation instructions, here. And you need to target Windows desktop, which you first need to install the tooling described in the desktop docs. Flutter by default assumes that you’re building production software and it isn’t configured to develop Windows apps. But, the following command line, fixes it:
$ flutter channel dev
$ flutter upgrade
$ flutter config --enable-windows-desktop
And note that every time you create a new Flutter app, using the extension support for Android Studio or Visual Studio Code, or from the command line, it creates a new windows subfolder.