Flutter for Windows is here | Flutter releases 2.10.0 which supports windows as a target
With half a million app in Play store and Apple store, flutter, as we all know, is a cross platform solution with the one codebase (dart). One can create beautiful apps which compiles to native code targeted to different platforms. Until flutter’s version 2.10.0 flutter supported only mobile app (both iOS and Android) and web apps. Flutter being best loved language since its release on mobile platform it has now expanded its horizon, Flutter’s new release supports windows. Yes, flutter developers can now create app for windows platform.
With half a million app in Play store and Apple store, flutter, as we all know, is a cross platform solution with the one codebase (dart). One can create beautiful apps which compiles to native code targeted to different platforms. Until flutter’s version 2.10.0 flutter supported only mobile app (both iOS and Android) and web apps. Flutter being best loved language since its release on mobile platform it has now expanded its horizon, Flutter’s new release supports windows. Yes, flutter developers can now create app for windows platform.
You can download the new release here : https://docs.flutter.dev/get-started/install/windows
Developers can simply upgrade flutter to latest version using :
flutter upgrade
After the update you need to have Visual Studio tool chain to develop Windows app. Check “flutter doctor” once to confirm
You can download the visual studio toolchain here
https://visualstudio.microsoft.com/downloads/
Download and install “ Desktop development with C++” to enable flutter windows development.
Now lets check how flutter works on windows.
Lets start by creating a new flutter project
flutter create windowsapp
Go to your directory
cd windows app
then to open your code in VSCODE use
code .
We can see a subfolder with the name “windows’
then to try flutter for windows run
flutter run -d windows
Your Windows app is ready
or use
flutter build windows
The Flutter executable, .exe, can be found in your project under build\windows\runner\<build mode>\.
Product manager at Flutter Tim Sneath in this medium blog Announce the release of flutter with windows as an app target. Tim wrote “Our goal with Flutter is to give you the tools you need to build a great experience, regardless of which operating system you’re building for. And so we want to bring the same core framework and tools to every place you might want to paint pixels.”
Flutter is great because it supports stateful hot reloads which give UI creators and developers to create fast and beautiful apps. Also many big companies uses flutter for their web apps and mobile apps.
Flutter now natively supports windows. Windows implementation of flutter combines dart framework and C++ engine. In simple words flutter framework works as a middle man to communicate to the windows system. Flutter uses the skia graphics engine to render animations, theming, test input etc. and has developed hundreds of widgets for the windows platform. Tim also stated the new release of flutter also integrates well with different APIs in the underlying operating system: desktop apps support everything from file system pickers to device hardware to data stores like the Windows registry.
Using flutter developers have the ability to play with huge array of packages covering from Windows taskbar integration to serial port access. Flutter’s new release comes with msix tool which can wrap your flutter code to windows installable package.
Distributing your application by self hosting it on a website requires a certificate signed by a Certificate Authority known to Windows.
Here is how to generate a self-signed .pfx certificate.
- If you haven’t already, download the OpenSSL toolkit to generate your certificates.
- Go to where you installed OpenSSL, for example, C:\Program Files\OpenSSL-Win64\bin.
- Set an environment variable so that you can access OpenSSL from anywhere:
"C:\Program Files\OpenSSL-Win64\bin" - Generate a private key as follows:
openssl genrsa -out mykeyname.key 2048 - Generate a certificate signing request (CSR) file using the private key:
openssl req -new -key mykeyname.key -out mycsrname.csr - Generate the signed certificate (CRT) file using the private key and CSR file:
openssl x509 -in mycsrname.csr -out mycrtname.crt -req -signkey mykeyname.key -days 10000 - Generate the .pfx file using the private key and CRT file:
openssl pkcs12 -export -out CERTIFICATE.pfx -inkey mykeyname.key -in mycrtname.crt - Install the .pfx certificate first on the local machine in Certificate store as Trusted Root Certification Authorities before installing the app.