News

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.

Universal Windows Platform
[Click on image for larger view.] Universal Windows Platform (source: Microsoft).

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.

 Flutter app running in a Windows UWP container
[Click on image for larger view.] Flutter app running in a Windows UWP container (source: Google).

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."

WinUI 3
[Click on image for larger view.] WinUI 3 (source: Microsoft).

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
[Click on image for larger view.] Project Reunion (source: Microsoft).

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.

Reunion Component
[Click on image for larger view.] Reunion Components (source: Microsoft).

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."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube