Flutter is now with Windows Alpha
Tags: flutter, android, ios, cpp
Published: 2020-09-28 08:06:18

At present, more than 1 billion devices are operating Windows 10, according to Microsoft, and Windows continues to be a well-known choice for the laptop as well as desktop devices. More than 50% of the Flutter developers are making use of Windows right now, and therefore, it has become a natural target when it comes to Flutter.

Different types of exciting possibilities have been opened up for Flutter thanks to the native desktop support which includes minimized friction for the new users, enhanced developer tooling, as well as apps feature which can reach any gadget that a user might possess from just one codebase.

Including Windows to Flutter
Flutter can be considered to be a cross-platform UI toolkit that has been designed for enabling the reuse of codes across various operating systems like Android and iOS while likewise helping apps to interface with other platform services directly. Their objective is to allow the flutter app developers to produce top-quality apps that will feel natural on various platforms while embracing differences and sharing the maximum number of codes.

The engine happens to be at the primary area of Flutter supporting the primitives required for supporting all the applications of Flutter. This engine rasterizes composited scenes once it is imperative to paint a new frame. It offers Flutter’s core API’s low-level implementation, which includes text layout, graphics, network and file I/O, plug-in architecture, accessibility support, as well as a compile toolchain.

What will the platform affect?
Every single new platform added to Flutter is going to expand the entire framework with innovative services so that it can shine on that particular platform. Including support for desktop form factors with Windows, web, Mac OS, as well as Linux help bring an entire set of innovative services which consist of powerful support for mice, keyboards, and controllers on the side of the input along with widgets which can adapt with bigger screen sizes which come with desktop and web apps.

Apart from this, every new platform is going to affect plenty of other things besides the Flutter engine and framework:

• Toolchain updates: including an innovative target to the IDE and CLI tools (Windows, in this case)

• Shell: support for managing input from Windows by utilizing WM_* messages as well as output by employing ANGLE, which makes use of Skia for rendering at indigenous speed to DirectX surface

•Plug-ins: A plug-in is a blend of native code and Dart code for every single of the platforms supported by the plug-in. It is important to add the native code for every single plug-in which is compiled on Windows into the Flutter app.

• Runner: a shell application is received by every project for supported targets. It happens to be a Win32/C++ program for Windows which will be loading the Flutter code and executing it at runtime. It happens to be a fantastic place for including native code to the application in case it is required.

A solid foundation is provided by this particular alpha release, which should be stabilized during the subsequent few months. Let us hope that this will provide the developers with something to start in the long run.

Exploring a few sample applications
You might like to explore some sample applications to see the support provided by Flutter for Windows. The first one of them known as the Flokk app had been produced in concert with the developers and designers at gskinner.com. The primary objective was to show that Flutter was prepared for the desktop by making an attractive and innovative Flutter desktop application. This particular app functions perfectly with genuine Google Contacts data.

In case you want to utilize this app on your Windows device, the latest version can be downloaded on GitHub. Apart from this, the Flutter Gallery app was rewritten completely for adding support for the desktop form factors.

Beginning with Flutter for Windows
Install the Flutter SDK as per the Windows installation guidelines and get started. It is imperative to install the tooling as described for targeting Windows desktop. Flutter, by default, accepts that you are developing production software, and it is not configured for developing Windows applications. Nevertheless, this can be fixed easily by applying a command line:

$ flutter channel dev

$ flutter upgrade

$ flutter config — enable-windows-desktop

After setting it up, every single time a new Flutter application is being created by making use of extension support for Visual Studio Code or Android Studio, a new Windows subfolder is going to be created too. Once your application has been created, a release-mode is going to be created as well.


Windows plug-ins
It is a fact that the Flutter community is already working on Windows plug-ins even though the alpha has been just released. Here we have mentioned some of the plug-ins:

• path_provider: Come across the path to any special direction on the machine of the user like temp or Documents

• url_launcher: helps to launch URLs from your application in the browser

• shared_preferences: Helps to keep the user preferences serially on disk between your app’s sessions

• biometric_storage: It is the storage which has been encrypted by biometrics

The primary advantage of making use of these plug-ins is the fact that other Flutter platforms are also supported by the majority of them that allow you to target your applications at iOS, Android, Windows, as well as web. Apart from this, although approximately 30% of the packages on pub.dev happen to be plug-ins with platform-specific code, the majority are not.