Flutter for Desktop App Development – Technical Preview of Key Features & Improvements

Flutter for Desktop App Development

Flutter is expanding its capabilities to desktop app development. Soon, you will be able to use the Flutter app development framework for a broad range of desktop operating systems – including Windows, macOS, and Linux. In a recent blog post, Tim Sneath, Flutter’s Product Manager, mentioned the company’s ambitious vision to cover virtually all kinds of computing devices. Flutter is already used in a variety of development projects. Be it Google Assistant, Cloud Search, or Blogger, Flutter already powers an impressive range of software platforms.

In this blog, we’ll discuss all the features and capabilities that Flutter is planning to release for desktop app development. Keep in mind that all these capabilities are under technical preview as of this writing.

Expanded Release Mode
The Flutter has added profile and release mode Windows and Linux. It has existing support for macOS apps. If you use the latest build of Flutter, you can compile a Flutter app to a Windows executable with ‘flutter build windows.’ This is based on the Flutter ahead-of-time (AOT) compiler. You can use the AOT to create a native x64 machine code. This code can be distributed to a device even without a Flutter.

Enhanced, Desktop-Class Experience
Desktop app development has its unique appeal that is different from mobile app development. Be it a simple app or an advanced progressive web app, desktop apps have diverse applications. Since desktop apps are usually landscape and resizable, the Flutter framework for desktop has been designed to address those requirements. Flutter has made a host of changes to offer an optimal desktop experience, including:

• The default template now includes a reference to a visualDensity property. This allows you to control the density based on the platform you are targeting, with more compact spacing for desktop apps.

• Better support for mouse and keyboard input. The changes include raw key codes on Windows, right-click mouse button, and cursor changes, among others.

• The updated support also enables you to query for the specific platform such as Windows, macOS, and Linux. The queries will provide you the appropriate results.

• The Flutter platform has also added a NavigationRail widget that is a tailor-made desktop-grade experience on desktop and tablet computers.

Foreign Function Interface For Platform Integration
The FFI is a velocity booster for platform integration. For APIs based in the C programming language, the ‘dart:ffi’ library provides a direct mechanism for integrating to the native code. Besides, the Dart runtime enables you to allocate memory on the heap supported by a Dart object and makes calls to all the dynamically linked libraries.

A Flexible Plugin Development Model
Most of you must be aware that Flutter has a small core. And the developers don’t want to make the core hefty. Adding plugins and packages from Flutter or third-party developers help the framework integrate with the underlying operating system. But with the continuous expansion of the framework to web and desktop, it requires more plugins from outside contributors having expertise in Flutter.

In order to define a common interface as part of the core plugin, Flutter has adapted a schema for plugins. This will enable seamless platform development across different authors. As part of this initiative, Flutter now allows you to explicitly declare the platforms supported by a plugin.

The official developers of Flutter are already building some of the core plugins using this plugin development model. You can explore some examples of the development model to understand the techniques better.

Flutter App Development For Windows
The Flutter team has been experimenting with various architectural approaches for Windows desktop apps. Like other platforms, on Windows too, Flutter is embedded into a small host container app. This relies on an approach used by game engines like Unity. This method helps to provide an entry point, coordinate with the operating system, and manage the message event loop.

While using Flutter for the Windows operating system, you have two approaches for creating the embedder. The first one is the mature Win32 programming model to create the entry point for flutter content. This method offers maximum backward compatibility with platforms like Windows 7. It builds a standard EXE file.

The second mode is the modern UWP app development model. This model is recommended for Windows 10. The UWP model enables you to opportunities for expanding the Flutter support to devices like Xbox and the upcoming Windows 10X.

Microsoft has decided to expand the support for Surface devices to include Android and Windows. Flutter plans to leverage this expansion by working in close collaboration with Microsoft and the contributing Flutter developers. With such collaboration, Flutter plans to create a native experience for Microsoft devices.

Wrapping Up
All these new features announced by Flutter are in technical review. The APIs and tools used in these development processes are not fully stable as of this writing. Flutter will release this major update once the desktop support is stable, has tried-and-tested accessibility, and localization support. Until then, you need to your enthusiasm up for working on Flutter desktop app development projects.

At Android Developer, we have had a fascinating journey with the Flutter Android app development framework. Being one of the earliest adopters of Flutter, we look forward to the upgraded desktop-ready version of the framework. Follow us on social media and web to get the latest updates about development tools and templates that make your life easier.

FAQs

Q. What is Desktop App Development?
Desktop apps run independently on a desktop or laptop computer, unlike web apps that need a browser. The development of desktop applications needs to ensure that the app can be locally installed on the computer having different operating systems, including Windows, macOS, and Linux.

Q. What are Progressive Web Apps?
Progressive web apps are websites that have adopted certain performance standards and features of the web, like resource-caching, offline-browsing. PWAs can be installed on your device.

Q. What is Flutter App Development?
Flutter is an open-source mobile app development kit created by Google. It is used to develop applications for Android, iOS, Windows, Mac, Linux, and the web from a single codebase. Flutter supports web app development using standards-based web technologies such as HTML, CSS, and JavaScript.

Q. How much does it cost to build a Flutter App?
The costs of developing a Flutter app depend on several factors. Design complexity, development time, type of features, etc. play an important role in calculating the costs. Android Developer delivers flawless Flutter apps at a competitive price.