How to make Windows Application with Flutter

Flutter are serious about what they say “write once, run anywhere“. A week ago (September 23, 2020) the Flutter team launched Flutter for Windows Alpha which can create standard .exe files to run on PCs as far back as Windows 7, up to Windows 10. Interestingly, just like Flutter for other platforms, we can use the Dart code which is the exact same for Android / iOS apps as you do for Windows and every other desktop platform.

Here is how to make windows application with flutter alpha version

1. Use development channel

$ flutter channel dev

2. Upgrade flutter version and set config for make it possible for windows development.

$ flutter upgrade
$ flutter config --enable-windows-desktop

3. create new flutter project

$ flutter create hello_flutter_windows

Because we enabling windows desktop development, so every time we create new flutter project it will have new folder called “windows

However, to be able to run the flutter we must install the Visual Studio toolchain which is only available in the Visual Studio application. If we didn’t have yet toolchain it will displaying error like this

Launching lib\main.dart on Windows in debug mode...
Exception: Unable to find suitable Visual Studio toolchain. Please run `flutter doctor` for more details.
Exited (sigterm)

4. Download and Install visual studio 2019 then select Desktop development with C ++

Download Visual Studio (1.3 MB) :

5. Now let’s run Flutter

$ flutter run
Windows Application with Flutter

As you can see, preparing for making windows app with flutter are similar with usual flutter project. And the different is only when we need Visual Studio toolchain.

Leave a Comment

Your email address will not be published. Required fields are marked *