Navigate back to the homepage

Setup Flutter Desktop on openSUSE

Pewrie Bontal
September 15th, 2021 · 1 min read

Setup Flutter Desktop on openSUSE

The prerequisites

I assume you’ve already installed Flutter SDK not from snapd. If you don’t have already, follow official doc on flutter.dev

Additional requirements for openSUSE

For Flutter desktop development, you need the following in addition to the Flutter SDK:

  • Clang
  • CMake
  • GTK development headers
  • Ninja
  • pkg-config

Installing additional requirements

1sudo zypper in clang gcc cmake ninja pkg-config gtk3-devel

NOTE THAT the package names shown in official doc (ninja-build & libgtk-3-dev) are (ninja and gtk3-devel) on openSUSE.

Set up

At the command line, perform the following commands to make sure that you have the latest desktop support and it’s enabled. If you see ”flutter: command not found”, then make sure Flutter SDK is in your path.

1flutter config --enable-linux-desktop

To ensure that desktop is enabled, list the devices available.

1flutter devices

You should see something like the following

11 connected device:
2
3Linux (desktop) • linux • linux-x64 • openSUSE Tumbleweed

Add desktop support to an existing Flutter app

To add desktop support to an existing Flutter project, run the following command in a terminal from the root project directory:

1flutter create --org com.example --platforms=linux .

This adds the necessary desktop files and directories to your existing Flutter project.

Now you can build linux app on openSUSE

1flutter build linux --release

For releasing linux app, follow official doc on flutter.dev

More articles from Pewrie Bontal

Hello again World

My Second Post.

June 1st, 2021 · 2 min read

Hello World

My First Post.

May 27th, 2021 · 2 min read
© 2021–2024 Pewrie Bontal
Link to $https://bontal.netLink to $https://twitter.com/pewriebontalLink to $https://github.com/pewriebontalLink to $https://instagram.com/pewriebontalLink to $https://linkedin.com/in/pewriebontal/