What You Need to Know About Flutter's Windows Alpha
Join the DZone community and get the full member experience.Join For Free
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 app 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 code-base.
Including Windows in 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 helping apps to interface with other platform services directly. Their objective is to allow 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 helps 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, has 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.
Starting 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:
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.
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, so you can target your applications at iOS, Android, Windows, as well as the 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.
Flutter for Windows Resources
It is important to go through the desktop documentation on flutter.dev whenever you want to proceed in your Flutter for Windows venture. Apart from this, you should go through Flutter codelab in case you like to write a Mac OS and Windows application consisting of code using OAuth and GraphQL.
Amongst the other useful widgets which happen to be desktop-oriented, the NavigationRail widget, the DataTable widget, and the menubar plugin are highly recommended. The InteractiveViewer widget might also create interest in you given that it consists of comprehensive desktop support for the mouse gestures out there.
One more beneficial widget that you can explore happens to be those from SyncFusion, which are quite popular in the Windows development community. A wide array of top-quality widgets is provided by them for making charts, data grids, gauges, and so on. All these widgets come with enterprise licenses which will help you to find the suitable one for your project.
This particular release will allow you to make your apps in any manner you like them along with a comprehensive set of Flutter debugging and development tools. Once it is complete, your application will be compiled to 64-bit code which you will be able to package and also bring to any other Windows machine. And finally, the identical code-base can be used to create an application targeting iOS, Android, Mac OS, web, as well as Linux.
Opinions expressed by DZone contributors are their own.