Flutter Update Furthers UWP Desktop Support
Google's popular cross-platform Flutter UI toolkit is out in a v2.2 update that furthers support for creating Universal Windows Platform (UWP) desktop applications.
Part of Flutter's appeal is its ability to develop a single codebase that can target mobile, web, desktop and embedded devices, specifically Android, iOS, Linux, macOS, web and windows.
With such mobile and cross-platform functionality, it has been compared to Microsoft's Xamarin. In fact, in that 2018 comparison, one Visual Studio Magazine reader commented, "My only problem with Flutter is its lack of UWP and Web support." At about that same time, though, a GitHub issue was published to Add support for UWP. That work has been spearheaded on a spare-time basis by James Clarke, working in evenings and weekends. Finally, in September 2020, Google announced support for classic Win32 APIs along with an experimental project for a UWP-based version of the Flutter shell, along with a Flutter Gallery proof of concept published to the Microsoft Store, running on Xbox, HoloLens, PCs, mobile devices and more. As of Flutter 2.0, released in March, the toolkit supported Android, iOS and web for production apps, with Windows, macOS and Linux still in beta.
Now, with the brand-new v2.2 update, the UWP support is advancing to alpha.
"Another update for Flutter in this release is for desktop lovers; support for Windows UWP has moved to alpha in the dev channel (beyond the stable 2.2 version)," the announcement post said. "UWP allows you to take your Flutter apps to devices where standard Windows apps don't run, including Xbox." The graphic below shows a Flutter/UWP demo app.
According to Google's "Desktop support for Flutter" documentation, developers must use Visual Studio 2019, in which the "Desktop development with C++" workload must be installed for Win32, while the "Universal Windows Platform development" workload is needed for UWP apps, along with the optional UWP C++ tools.
After that, the new v2.2 announcement post details some work that needs to be done to get started, including overcoming some UWP limitations: "Because you're building a Windows UWP app, which runs in a sandbox environment on Windows, you'll need to punch a hole in the app's firewall on localhost during development to enable things like hot reload and debugger breakpoints."
The enhanced UWP functionality comes well after some industry pundits have declared the death knell for UWP. Microsoft, though not admitting such a death knell for UWP, has been working on using some of its underlying tech in other places. In May 2019, Microsoft's Kevin Gallo said, "And, you've told us that you would like us to continue to decouple many parts of the Universal Windows Platform so that you can adopt them incrementally such as WinUI, MSIX, and Windows Terminal."
Indeed, WinUI 3, part of Project Reunion, was described by Sam Basu, a developer advocate at Progress, as "a whole UI stack that actually promises to run on both Win 32 -- so .NET runtimes and .NET 5 and 6 -- but also UWP, which is .NET native. You got the best of both worlds. You can bring in C#, you can bring in C++. That's all the Windows and XAML."
As Nick Randolph describes in an extensive look at the future of Windows development, just published yesterday (May 18), that effort is continuing with Project Reunion:
There are reasons why UWP isn't suitable for all applications wanting to run on Windows. However, there are many features of UWP that are the cumulation of years of investment in the underlying technology stack and shouldn't just be discarded. These include the XAML UI layer, the way resources are managed for different localizations, screen resolutions and device families, and the app lifecycle that allows for efficient handling of suspending and resuming the application.
If developers weren't going to migrate away from their technology of choice, Microsoft needed to find a way to lift the features out of UWP and package them in a way that they could be used within any Windows application. This is the goal of Project Reunion.
Project Reunion, which Microsoft says "provides a unified set of APIs and tools that can be used in a consistent way by any app on a broad set of target Windows 10 OS versions," is now one of a growing -- if not dizzying -- number of desktop dev options now available (including UWP), as we covered here and here.
Coincidentally, in that latter March article, Flutter came up in reader comments.
"A hundred different ways to make apps, but never what we ask for," said one reader. "I guess it'll take Flutter completely decimating Microsoft's developer base before they wake up."
Another reader replied, "100% agree. Flutter will replace the developer's window on Windows. And who's going to care what backend lies behind? Microsoft, IBM, AWS, Google - it won't matter."
David Ramel is an editor and writer for Converge360.