Say hello! 👋 to Flutter Desktop 🤗 (Windows + macOS + Linux)

Thilina Weerasinghe
5 min readMar 24, 2022

Flutter play a major role in building beautiful, natively compiled, multi-platform applications. Now Flutter consider as the the most popular cross-platform framework in the world. Flutter has bridged the gap between Android application and iOS application development, now Flutter is expanding it to the web, desktop and more, growing closer to the “write once, run anywhere” dream.

In February flutter 2.10 released by the Google’s Flutter team with fixing bugs and adding new features to Flutter framework. Flutter 2.10 release brought the stable release of desktop support. Flutter Desktop support allows flutter developers to compile Flutter source code to a native Windows, macOS or Linux desktop application.

“We’re delighted to see Flutter adding support for creating Windows apps. Windows is an open platform, and we welcome all developers. We’re excited to see Flutter developers bring their experiences to Windows and also publish to the Microsoft Store. Flutter support for Windows is a big step for the community, and we can’t wait to see what you’ll bring to Windows!” — Microsoft’s Kevin Gallo

This is a thoughts about flutter desktop from Microsoft and also flutter team day by day improve performance according to Product Manager for Flutter Tim Sneath, flutter team work hard on these projects to make flutter even better.

Let’s Try Flutter desktop🤗

You can use Android Studio, IntelliJ IDEA or Visual Studio Code and install the Flutter and Dart plugins to enable language support and tools for refactoring, running, debugging, and reloading your desktop app within an editor.

Additional Windows requirements🙄

For Windows desktop development need 🧐

Visual Studio 2022 When installing Visual Studio select the “Desktop development with C++” workload, including all of its default components, to install the necessary C++ toolchain and Windows SDK header files.

Note: Visual Studio is different than Visual Studio Code.

Additional macOS requirements

For macOS desktop development need🧐

Xcode

CocoaPods if you use plugins

Additional Linux requirements

For Linux desktop development need🧐

Clang

CMake

GTK development headers

Ninja build

pkg-config

liblzma-dev This dependency may be required

By running flutter doctor Command on terminal we can check🧐 Flutter environment is ready or not for the development. It shows all the details. If not ready you can fix issues by understanding given information by flutter doctor.

PS E:\flutter dev\thilina\Wallet Tracker\wallet_tracker> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on Microsoft Windows [Version 10.0.19043.1586], locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[✓] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.2)
[✓] Android Studio (version 2021.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
• No issues found!

At the end of this article, surely you shall be able to run a flutter app on desktop….

first you need to enable desktop support on your pc.

Enable Desktop Support:

To enable Flutter, we can run the following command to allow it to installation wide:

flutter config --enable-<platform>-desktop
  • flutter config --enable-windows-desktop to enable Windows.
  • flutter config --enable-linux-desktop for Linux.
  • flutter config --enable-macos-desktop for macOS.

Confirm again by running

flutter config

3. Check the devices support:

Next up, you can run the following command to get a list of connected devices.

flutter devices

Fetch platform files

Go to file directory and you should see these files

You can run the program using CMD or IDE

CMD

flutter run

or using graphical user interface of IDE.

Create a new application in your IDE and it automatically creates iOS, Android, web, and desktop versions of your app. From the device pulldown, select windows (desktop), macOS (desktop), or linux (desktop) and run your application to see it launch on the desktop.

From the command line

To create a new application that includes desktop support (in addition to mobile and web support), run the following commands, substituting myapp with the name of your project.

$ flutter create myapp
$ cd myapp

To launch application from the command line, enter one of the following commands.

C:\> flutter run -d windows
$ flutter run -d macos
$ flutter run -d linux

Build a release app

To generate a release build, run one of the following commands:

PS C:\> flutter build windows
$ flutter build macos
$ flutter build linux

Add desktop support to an existing Flutter application

To add desktop support to an existing Flutter project, run the following commands in terminal from the root project directory.

$ flutter create --platforms=windows,macos,linux

This adds the necessary desktop files and directories to your existing Flutter project. To add only specific desktop platforms, change the platforms list to include only the platform(s) you want to add.

Very excited about this addition and it’s pretty cool. However, some plugins might need platform-specific configuration small changes for give a great user experience for users.

Flutter is growing so fast with new features. This years Google I/O going to be held on May 11–12, 2022 let’s hope to see some exciting news and features about Flutter.

Try Flutter desktop and ✌️….Happy Cording with Flutter.♥️🖖

--

--