头图

From the beginning of Flutter's creation, we have been committed to creating a cross-platform application solution that can build beautiful, highly customizable, and can be compiled into machine code, so as to give full play to the full graphics rendering capabilities of the device's underlying hardware. Today, Flutter's official support for production versions of Windows is an important sign of the realization of this vision. It enables Windows developers to enjoy the same productivity and functionality of mobile development.

用 Flutter 构建 Windows 桌面应用程序

Flutter's goal is to give you a great build experience on any platform, and what we want to do is to do it with the same core set of frameworks and tools. With Flutter, you are free to create a beautiful experience to make your brand and design stand out; it also has because it will be compiled directly into machine code; and by supporting stateful hot Overload functions to provide an interactive experience, allowing you to see the results of code changes directly while the application is running, in productivity. Flutter is open, with thousands of contributors building the core framework or extending it through an ecosystem of packages and plugins.

<highlight>To date, nearly 500,000 apps have been built with Flutter</highlight>

We have seen this trend so far exceed our expectations. Including some large companies such as Betterment , BMW and ByteDance, etc., and more than 30 teams within Google use Flutter. According to Statista and SlashData, Flutter has become the most popular cross-end UI toolkit in 2021.

Our own data backs this up, with 92% of Flutter developers in our four-quarter 2021 developer survey being satisfied with the tools we provide. (For the other 8%, we are listening to your feedback and hope to get your satisfaction too).

One of the common needs is support for Windows,

Today, we are happy to announce that we have full support for building Windows desktop applications in the stable version of Flutter released this time!

Windows and Flutter

A few years ago, we had a big vision for Flutter to expand from mobile apps on iOS and Android to other platforms, including and .

The core of Flutter is cross-platform: from the portable hardware-accelerated Skia graphics rendering engine, to the core elements of Flutter's rendering system, such as animations, themes, text input, and internationalization, Flutter provides hundreds of widgets.

But desktops aren't as simple as mobile apps running on a larger screen, they're very different by design. From an input device perspective, there are keyboards and mice on the desktop, which run multiple variable-sized windows on the monitor. There are different rules and constraints for key content such as accessibility, input methods, and visual styles. And they also integrate with different APIs in the underlying operating system: desktop applications support everything from the system's file picker to device hardware to data storage such as the Windows registry.

So when we brought Flutter to Windows, we also needed to customize it.

As with our Android and iOS support, the Windows implementation also includes the Dart framework and the C++ engine. Windows communicates with Flutter through the hosts the Flutter engine. Translating and sending Windows are the responsibility of the . Flutter works with Windows to draw your UI to the screen, handles events like window resizing and DPI changes, and works with existing Windows like input method editors.

Flutter 在 Windows 平台的架构

On Windows, Flutter uses the exact same set of Dart code, but is able to use the Windows API.

Your app can use the full capabilities of the Flutter framework, and on Windows it can also communicate with Win32, COM, and Windows Runtime APIs directly through Dart's C interop layer or using platform plugins written in C++. We've also adapted many common plugins to include support for Windows, including camera , file_picker , and shared_preferences . What's more, the community has added various other packages to support Windows, covering everything from Windows taskbar integration to serial port access.

目前已经有上百个 package 为通过 Flutter 构建 Windows 应用程序提供了适配。

To fully customize the UI for Windows, you can also create apps with Microsoft Fluent design aesthetics using packages such as fluent_ui and flutter_acrylic . And use the msix tool to wrap your app into an installer so it can be uploaded to the Microsoft Store on Windows.

Overall, this facilitates the creation of applications on the Window platform. Runs on Windows at breakneck speed while being able to transfer to other desktop or mobile applications and web platforms. Let's take a look at some early examples so far:

一些使用 Flutter 构建的 Windows 应用程序的早期社区示例,特别展示来自深圳团队的一款应用。

Microsoft and Flutter

We asked the Windows team if they would like to share some words about Flutter support. Here's a comment from Kevin Gallo, VP of Windows Developer Platform at Microsoft:

"We're excited to see Flutter add support for creating Windows applications. Windows is an open platform, and we welcome all developers. We're excited to see Flutter developers bring their experiences to Windows and publish to Microsoft Store. Windows support is a big step for the Flutter community, and we can't wait to see what amazing apps you can bring to Windows!

In fact, many teams at Microsoft also contributed greatly to today's release. We especially want to thank the Fluent design team for their contributions to supporting icons for Flutter apps on Windows. Their high quality fluentui_system_icons package has been added to the Flutter Favorite project.

At the same time, we've been impressed by Microsoft's investment around Windows accessibility, and we'd like to thank the team for their help in ensuring that Flutter can support screen readers from day one. It's a mistake to think of accessibility features as an additional requirement. As shown in this image from the Microsoft Inclusive Design Toolkit , we must focus on delivering experiences that are permanent, temporary, or needed in different contexts.

The following video demonstrates how Flutter integrates Windows Narrator functionality. For the purpose of this video, we've purposely blurred the screen to give you an idea of the value of this feature to users who need it.

Windows Narrator is a screen reader for Windows that also works well in Flutter apps.

Windows Development Ecosystem Toolset

Our development tool partners are also starting to add support for Windows desktop application development, such as:

  • FlutterFlow is a low-code, drag-and-drop tool for generating Flutter applications. FlutterFlow officially announced today that it supports the Windows platform, as well as a number of features that help Flutter developers build desktop applications.
  • Realm is a fast local data storage service. 's latest release today supports building Windows desktop apps with Flutter , they use Dart FFI to quickly access the underlying database, and add to their existing support for mobile platforms like iOS and Android.
  • The Nevercode team has updated their Codemagic CI/CD tool to support Windows desktop so you can test and build Windows apps in the cloud and publish them to the Microsoft Store.
  • Syncfusion Updated tool suite to take full advantage of the Windows platform. If you are using the services they provide, you will find that their data visualization components, such as treemaps, linear gauges, spark charts, calendar components and even PDF and Excel generation components already support Flutter, and the Syncfusion Flutter widget uses Dart Built natively.
  • Recently, Rive announced the Windows version of its popular graphics tool suite, which enables designers and developers to create interactive vector animations that respond to code in real time using state machines. The upcoming Windows version of the app offers amazing performance and a lower memory footprint, and will be available for download in the Microsoft Store soon.

We are very excited to see the mature ecosystem built around Flutter. When you start building Windows applications with Flutter, we encourage you to try out the services and tools of these partners in the ecosystem.

Windows platform support in Flutter 2.10

As part of the official release of Flutter 2.10, Flutter can already provide stable, production-quality support for building applications for the Windows platform, and Flutter 2.10 also includes many other new features and performance improvements and bug fixes, in another tweet today. has been introduced in detail.

In the next few months, we will announce more news about stable version support for macOS and Linux platforms, so that you can build beautiful applications for more comprehensive desktop platforms, web platforms and mobile platforms through Flutter!

Thanks again everyone for supporting Flutter and looking forward to seeing your awesome apps built for the Windows platform!

Thanks


Flutter
350 声望2.5k 粉丝

Flutter 为应用开发带来了革新: 只要一套代码库,即可构建、测试和发布适用于移动、Web、桌面和嵌入式平台的精美应用。Flutter 中文开发者网站 flutter.cn