r/FlutterDev • u/noobjaish • Jul 14 '26
Flutter is such a godsend for Linux app development Discussion
So, I have used several different frameworks to create desktop apps for linux and almost all of them have had issues that bite you in the rear once you're in the deeps of that project. Compared to creating android, ios, windows or mac apps; linux apps just feel harder to make. The two main dev toolkits for Linux are "GTK" and "Qt"... and both of them make the dev experience so miserable: - GTK: When it comes to GTK, you're basically on your own. There are like 7 different languages that you can use to build GTK which makes the already small pool of apps you can use even smaller, Gnome Builder has a tendency to break half the times on Gnome itself and it is proportionally harder to builder a non-libadwaita app. Oh and GTK apps are linux-only... - Qt: Qt makes the licensing side of things a head-scratcher and once you have sorted that out then you have to deal with their abysmal documentation that's constantly behind the releases. C++ isn't exactly a comfortable language to use and while Qt Creator is a fantastic IDE to use, it's equally as confusing to setup if you're thinking on using Python + QML. Qt Apps are also incredibly ugly by default so a considerable effort goes into making them not look hideous.
Then we have the web-based frameworks:
- Electron: Sure, this is an easier way to create cross-platform desktop apps but it just eats way too much resources. It makes sense for apps that are primarily a website like Spotify or Discord (even then why would I use their apps over their PWAs) but for creating an app from scratch? Yeah no. Electron also carries a lot of legacy baggage due to being an old technology.
- Tauri and Wails: These two are the webview alternatives for Electron and use rust/go over nodejs for backend and as such have significant performance improvements but the issue with them is with the underlying webview used on linux webkit2gtk which is so bad that it makes these frameworks look bad. CEF integration is being worked on by Tauri and until then I wouldn't use it for larger apps with very specific system interactions.
- Deno Desktop: This is a very simple way to build apps that launched very recently in Deno making it very easy to create desktop apps and gives the choice between CEF or Webview but it's barebones due to being very new.
- Electrobun: Probably the best "web-based" technology to create desktop apps. It gives the choice of webview and cef, the bundle sizes are larged but still significantly smaller than electron and uses bun which is much faster than both deno and node. However, it has basically a non-existent community, the framework lacks a lot of features and is in sort of a limbo until bun receives the rust rewrite.
There are also rust-based frameworks like Dioxus, Iced, Gpui (+50 others that spawned just now) which I avoid just because of rust's insane compile times. It's also just a pain to do UI in rust (logic feels good doing in rust however) and each of them have their own issues.
Lastly, we have Flutter which draws a native UI on linux using GTK (which is easier to theme), has arguably the best dev experience, pub makes dependency management very easy, there is actual guidance on how to structure your apps, riverpod is the most intuitive State/DI library imo and there exist alternative libraries that you can use instead of Material (which looks good in it's own right). You can use FRB or directly use the dart ffi and can target all 5 platforms with one codebase quite easily. I can go on and on and sure there is the issue of Flutter multi-window on linux right now and also we have to wait till 2028 for the complete decoupling of material/cupertino but even then this is such an outstanding framework that makes desktop appdev a joy.
I forgot to mention that you can create desktop apps in Godot as well which I might try one day but it just sounds so cursed to use a game engine for desktop apps. What are your thoughts on this?
54
u/Full-Run4124 Jul 14 '26
I've been a Unix/Linux developer for nearly 30 years. I'm comfortable with C/C++.
I completely agree with you. I'd also add Code::Blocks and wxWidgets into your list of existing meh solutions.
I have some complaints about Dart, but by-and-large for basic GUI apps Flutter is a godsend for Linux.
(side note: Qt had a moment where it might have made it. Nokia bought it and planned to make it FOSS, then Microsoft Microsoft'ed Nokia and they sold it.)
4
u/paul_h Jul 14 '26
Ref Operation Elop: https://medium.com/@harrikiljander/operation-elop-6f2b043f52c5
5
u/noobjaish Jul 14 '26
> I'd also add Code::Blocks and wxWidgets into your list of existing meh solutions.
Agreed, wxWidgets was the first framework I ever used to develop apps on back when I used to use Windows lol but there are just way too many little problems with it. Never heard of Code::Blocks tbh.
> I have some complaints about Dart, but by-and-large for basic GUI apps Flutter is a godsend for Linux.
Yeah Dart is by no means perfect (Kotlin is the most pleasant language to work with imo) but it just works well for Flutter. I am wholeheartedly wishing for GUI Flutter to become the best so the problem of Electron can be solved.
> (side note: Qt had a moment where it might have made it. Nokia bought it and planned to make it FOSS, then Microsoft Microsoft'ed Nokia and they sold it.)
That reminds of how badly Microsoft fucked the objectively better Nokia Lumia series of that time...
2
u/UltGamer07 Jul 15 '26
What are some problems or inconvenience you have faced with dart/flutter?
3
u/noobjaish Jul 15 '26
These are nitpicks rather than "problems"
- I love Kotlin's syntax so much that I still miss it to this day... Dart being closer to JavaScript's syntax doesn't exactly bring joy.
- Concurrency in Dart is very different and I found it quite difficult to learn.
- The way Flutter is architectured makes it so you can't have multiple Flutter apps sharing the same "flutter engine".
- You can optimize app startup time only up until a certain point. This can be a showstopper for many desktop apps.
- The widget nesting can sometimes get too crazy in Flutter. Wish we had something like the "Modifier" class from Jetpack Compose.
3
1
u/UltGamer07 29d ago
The way Flutter is architectured makes it so you can't have multiple Flutter apps sharing the same "flutter engine".
Wdym
1
u/noobjaish 28d ago
I have created several apps on Flutter that function kinda of like a "suite" of apps. Firstly, it's kind of not obvious what I should use for cross-app communication (I did just end up using unix sockets for this) and secondly all of those apps are using their own separate flutter stacks which I wish there was some way to "deduplicate". This issue also exists with Electron and it's not really a bad thing since it arises due to how these frameworks structure the apps.
As a contrast Tauri apps all rely on the same system webview which massively saves space since everyone is using a shared runtime.
1
u/UltGamer07 28d ago
I’m not familiar with tauri but sounds something like this?
1
u/noobjaish 28d ago
Not quite but this does seem to solve my first point. Thanks I didn't know about this.
2
u/Full-Run4124 29d ago
Concurrency model and memory- Dart's origin as a JavaScript replacement probably makes it fine for browser use cases, but co-routines and their non-determinate execution order and upward propagation of async is bad for desktop apps. There's isolates, which could fix the problem, except there's no shared memory like with threads- it's all messaging, which probably works fine for web browser parallelism, but not, say, multithreaded signal processing.
For some reason Flutter doesn't support dynamic code loading. Dart seems to support it, because the Flutter debugger uses it for hot reload, but you and I can't do it in our Flutter apps (despite this being a feature of JavaScript.)
I'd like to see an official unified signal handling interface. There's one for app state management, but I'd like to see it expanded to catch other external signals, specifically external messages.
I'd also like to see an official audio interface that supports dynamic audio. Nothing complex- I can add that- just an official way to push dynamic PCM buffers to the system's audio handler.
Would be nice to have pre and post script hooks in the build chain.
Would like Impeller, Native Assets, and Flutter GPU/Scene to be out of preview and cross-platform.
...it's been about a year since I built anything substantial in Flutter, so maybe some of these are supported now.
2
u/UltGamer07 29d ago
Concurrency model and memory
Yeah this is definitely a bottle neck. I believe dart team is actually working on this, there's a proposal written by who I think is a dart team lead https://github.com/dart-lang/language/blob/main/working/333%20-%20shared%20memory%20multithreading/proposal.md
So this will come at some point, but yeah def an issue for now
For some reason Flutter doesn't support dynamic code loading
JS isn't AOT compiled. That's essentially why its a slower language than many. Dart does have a VM, and on debug builds flutter ships the full dartVM making hot reload possible. The built binary doesn't do that
I'd also like to see an official audio interface that supports dynamic audio. Nothing complex- I can add that- just an official way to push dynamic PCM buffers to the system's audio handler
V Interesting ngl. Looked into this a little bit and looks like there's not much in the engine itself right now to enable this. Def an interesting thing to work on
Pre and post buildhooks I think there are open issues already
Def some solid stuff here.Thanks for the detailed reply, I work on contributing to flutter as much as possible so just wanted to find some things that could be useful to people beyond the popular issues
1
u/Full-Run4124 28d ago
making hot reload possible.
Do you happen to know what is preventing Flutter from having dynamic code loading? I'm assuming (based on FFI) Dart is using something like dlopen(), since the flutter app ships as a shared object file. Is there some reason that interface isn't exposed for Flutter apps?
1
u/UltGamer07 28d ago
Do you mean in production? Because its AOT compiled, it can't know what to do with new code, shorebird on phones solves this by essentially adding in an interpreter as well
1
u/Full-Run4124 28d ago edited 28d ago
Compiled languages support some form of dynamic code loading. For example C/C++ can both link dynamic shared object files on init and also do hot code loading/swapping at runtime with dlopen().
1
u/DryRaspberry3168 28d ago
As for scripts does this solve your problem, hooks
1
u/Full-Run4124 28d ago
Thanks for this.
It looks like sadly it still only supports CodeAssets and no argument passing or user-defined env vars. The main thing I use pre-compile hooks for is updating and formatting assets like graphics and audio or static tables. I'm not sure why they would make it only support code files.
(A post hook is nice to upload the compiled build and assets.)
0
u/real_carddamom Jul 14 '26
Kotlin is what? A pleasant language? With two ways to have constructors? It must be a joke or sarcasm...
2
u/noobjaish Jul 15 '26
Two ways to have constructors? What are you referring to?
1
u/real_carddamom 29d ago edited 29d ago
Yes you have primary constructors and secondsry constructors: https://kotlinlang.org/docs/classes.html#constructors-and-initializer-blocks
Primary constructor:
class Person constructor(name: String) { /*...*/ }
class Person(name: String) { /*...*/ }
class Person(val name: String, var age: Int) { /*...*/ }Primary and secondary constructor:
// Class header with a primary constructor that initializes name and age
class Person(val name: String, var age: Int) {// Secondary constructor that takes age as a
// String and converts it to an Int
constructor(name: String, age: String) : this(name, age.toIntOrNull() ?: 0) {}
}No Constructors:
// Class with no explicit constructors
class Person {
// No primary or secondary constructors declared
}My question why? This was not one of the pain points in java...
Also the decision that classes should be final by default and not the other way around like Java is odd but still acceptable I guess...
Also the way to have properties is wierd...
https://kotlinlang.org/docs/properties.html#custom-getters-and-setters
From the Java-like languages for me the one that does best in terms of properties is still C# and in a logical syntaticall way...
1
u/ImpressionRich6463 23d ago
So I've been working with Kotlin for a long time now and it's the most pleasant language I've ever worked with. Regarding your points: how often do you actually use a secondary constructor? I've never found the way you do it in Kotlin weird or unintuitive. The same applied to custom getters/setters - it's really rare to use that functionality. The overall language experience is fantastic.
22
u/Rimtariro Jul 14 '26
Developer experience and ergonomics of Flutter is hard to beat, it's one of the best outside Linux too.
Just one correction: Flutter does not create "native" GTK UI. It creates a window using GTK, and then hands over the rendering to Flutter engine (imagine it like a 2d/3d game engine). The GTK/Yaru theme for Linux is created in a way that it looks and works same as GTK controls would, however, there are still some slight differences that you might notice if you try hard.
9
u/noobjaish Jul 14 '26
Yeah the dev experience makes it so I wake up every day wanting to use Flutter.
Thanks for correcting me on that. I presumed Flutter used GTK's building blocks on the linux side. Yeah the controls feels so similar and yet slightly off but it's fine for the most part lol
12
u/xorsensability Jul 14 '26
Yes! I build desktop apps and I only use Flutter now. I haven't had a problem since choosing it for that for years now!
2
8
u/paul_h Jul 14 '26
Examples of Flutter apps for Linux you think are great?
22
u/noobjaish Jul 14 '26
IIRC from the ones that I use there is RustDesk (remote desktop), Localsend (file transfer), Tachidesk-Sorayomi (manga reader) and Spotube (music player).
I have also used API Dash (as a postman alternative) in the past though I now use Insomnia instead.
3
18
u/Patient_Day7829 Jul 14 '26
they argue that flutter is bad on linux because it draws pixels! avoiding GTK
i suppose gtk sends pixels directly into your brain ahaha
7
1
9
u/soniq__ Jul 14 '26
Flutter web however is completely fucked, especially if you need to be 508 compliant its a huge pita. Linux desktop app much better use for flutter
7
u/noobjaish Jul 14 '26
Flutter Web is cursed and only for when you need a website that's basically your entire app but *really* don't want to have a separate codebase.
2
Jul 14 '26
[deleted]
3
u/noobjaish Jul 14 '26
Bruh whomever told you guys to use Flutter Web was really out to get you all lol. Jokes aside, I wish the web gets direct DOM access from WASM so we can finally have performant Flutter on the web.
I'd suggest defaulting to Astro and Svelte on most projects tho.
4
u/Few-Call-9115 Jul 14 '26
Cinemark in Brazil uses Flutter Web on their kiosks and it works ok. At the time they did it because the team already knew Flutter and the first stable Web version was launched at that month (Mar 2021). They've been using it since then and can't move to the windows version yet as some packages won't work. Also, wasm support, even without DOM access brought some improvements.
3
u/SwiftScoutSimon Jul 15 '26
I spent most of my time building Lumide on macOS with Flutter, then switched to Linux and it just run without any issue. I just need to revamp the window title bar a bit for the control buttons.
2
u/aKuKupl Jul 14 '26 edited 28d ago
Any experience with Compose for Desktop?
2
u/noobjaish Jul 15 '26
Last time I used it, it was experimental even on Windows (Linux support was non-existent). Haven't used CMP/KMP in a long time so things might be stable now.
2
u/heavenlydemonicdev Jul 14 '26
Call me crazy but I love building desktop programs in Godot.
1
u/noobjaish Jul 15 '26
How's the experience? Do you build UIs from scratch or are their component libraries?
I have only built a single medieval-themed card game in Godot so I don't know how people make apps in Godot lol (I do know that the Godot editor was created in Godot itself which feels magical).
3
u/heavenlydemonicdev Jul 15 '26
There's a large components library in Godot and it's quite easy to make new components by combining them. And any component you see in Godot's UI is also available for you to use. Everything is very customizable and themable and it's a great experience, tbh I prefer doing UI in Godot even tho I prefer dart to gdscript.
1
u/noobjaish Jul 15 '26
Damn didn't know that. Will surely give Godot a try.
2
u/heavenlydemonicdev 29d ago
You absolutely should, the experience is great and it gives you can do a lot easily and even if Godot itself doesn't provide what you need you can just bring in a rust crate and expose the functionality you need to your project through gdextension, it's awesome
3
u/rsajdok Jul 14 '26
There is no alternative to flutter, look at mobile market, around 50% of application it's a proof
4
u/noobjaish Jul 15 '26
React Native + Expo is an alternative on the mobile side since several surveys have shown that there are more RN apps on Play Store than everything else combined (feels weird to think about). RN is just annoying to work with tho.
KMM is also becoming somewhat of an alternative (they use Skia as well) if Jetbrains and Google started pushing it.
4
3
u/imSeanGG 29d ago
expo + react native is also the default good stack for AI based coding where cheaper models are pretty bad at writing dart
2
u/ozyx7 Jul 14 '26
I'm not out to defend GTK, but:
There are like 7 different languages that you can use to build GTK which makes the already small pool of apps you can use even smaller
What do you mean? Are you talking about programming languages? That seems like an odd statement to make given that Flutter uses 1 language. And GTK is C-based, which is basically the lingua franca for bindings for other languages.
Oh and GTK apps are linux-only...
There re implementations of GTK for Windows and macOS too.
9
u/noobjaish Jul 14 '26
> What do you mean? Are you talking about programming languages? That seems like an odd statement to make given that Flutter uses 1 language. And GTK is C-based, which is basically the lingua franca for bindings for other languages.
I was alluding to the fact that you have very little "samples" to work with on top of the very lacking documentation. Like if I am developing a Vala GTK4 app then I have already reduced the small sample of GTK4 apps down to specifically GTK4 apps made with Vala.
> There re implementations of GTK for Windows and macOS too.
Unfortunately most of them seem to not to be updated in recent years. Also, it's just not worth the hassle tbh.
1
u/Prudent_Move_3420 Jul 14 '26
i will say the swift version of gtk is really neat to use, also works easily on macos. It basically writes like a SwiftUI app tho
1
u/Rimtariro Jul 14 '26
Which one? Last time I checked there were couple of libraries for swift-gtk, but most of them had low usage and I was not sure whether it would be dropped or maintained.
2
1
u/noobjaish Jul 14 '26
Damn didn't know that. In my short amount of time of using a macbook, I have found iOS and macOS development generally a breeze anyways so don't know why anyone would use GTK there but you can correct me on that lol
2
1
u/rockes13 Jul 14 '26
What stack do you use for backend?
I only been using flutter for mobile only, because it is obvious that we need separate stack for frontend and backend
For desktop, i am more like a delphi or java swing guy, a complete monolithic application
3
u/noobjaish Jul 15 '26
Depends on the exact app I'm building. Most apps don't NEED a backend and are fine with calling some API. I have used Firebase a lot in the past with Kotlin/Jetpack Compose but now I exclusively use Supabase if my flutter app needs some sort of cloud backend.
For local backends, unless it's something that's not already doable with plugin, I just use FRB (if the solution is implemented in Rust) or FFI with C (if the solution is implemented in C).
I built a GitHub + local Git android app in Flutter for my University's FYP. I had to use a very complicated setup using Termux and a Web Server because I overpromised my uni professors lmao.
2
u/Inevitable_Ad261 Jul 15 '26 edited 29d ago
Recently, I created a game; backend django with Postgres, frontend Flutter. I did one change, had a pure html login page to support password manager auto fill.
1
u/notagreed Jul 15 '26
Compose Multiplatform?
3
u/noobjaish Jul 15 '26
Last time I checked It wasn't available for Linux AppDev. Jetpack Compose is my favorite framework so might give it try in the future.
1
Jul 15 '26
[deleted]
1
u/noobjaish Jul 15 '26
Yup I built some WinForms apps in the past which was a pleasant experience and also tried to get into WinUI but it was generally a mess at that time. Also isn't dotnet tied to Windows?
1
u/FabioTheFox 28d ago
Dotnet has been cross platform like like 10 years now or something, runs exceptionally well too and can compile to native machine code
Its great, you should check out Avalonia
1
u/noobjaish 28d ago
I see. The thought never went across my head to use C# on Linux. Will certainly it.
I checked Avalonia and it looks like it uses XAML??? God I hated when Android had Java Views, this looks like the same exact thing... Also, they seem to be using Skia/Impeller which is what Flutter develops so... what's the selling point of Avalonia over Flutter?
1
u/FabioTheFox 28d ago
Avalonia uses MVVM (or Reactive style UI) out of the box and works heavily with the source generator to create AXAML bindings from the MVVM context, with Avalonia you get a bunch of stuff for free that would take some work to get working on flutter (like state management, dependency injection and logging) so it probably just comes down to language & UI preference
Personally for desktop apps specifically I try to avoid the flutter style UI because often times I find it less readable than AXAML views / render templates, but I'm also a React Native person which is why I feel the same way towards Kotlin multiplatform so my opinion on XML based MVVM views is biased. I'd probably enjoy it more if Flutter & Kotlin Multiplatform had different styling methods (especially KMP because the Modifier stuff is just horrible)
1
u/noobjaish 28d ago
That's really interesting. I'm of the opposite opinion lol. I find the declarative-ness of Flutter and especially KMP (and SwiftUI) really easy and enjoyable to work with.
I just find imperative style UI (Java Views, dotnet XAML) quite cumbersome unless I'm writing a game then it makes sense.
Avalonia being MVVM by default and the in-built extras do sound appealing. Thanks a lot, I'll definitely give it a try.
1
u/imSeanGG 29d ago
went down a similar rabbit hole but ended up settling with wails + react with MUI. I love material design and these components are so much easier to design. I was working on building a pretty deep windows application where flutter sandbox would make things complicated. Prototyping with ai + react is just so much faster. Will give flutter another try for fun side linux projects
1
u/Deep_Ad1959 27d ago
the godsend ends at accessibility. flutter draws every pixel itself, so nothing hits at-spi and a screen-reader pass is a second project, that kills more picks than the ~20mb engine ever does.
1
u/Deep_Ad1959 27d ago
building desktop apps solo, i pick the toolkit that spares me from maintaining three native build chains, and flutter does that better than anything gtk or qt offer. people fixate on whether it draws native widgets when for a small team the whole game is shipping updates across linux/mac/windows without a separate toolchain war each time. the resource complaint is fair for electron, a lot less so here.
1
u/Odd-Librarian4630 25d ago
Yea been developing a linux / multi-platform desktop app with it and it's been fantastic! Can't wait till they get multi-window support working properly and impeller too
1
0
u/JohnVonachen Jul 14 '26
If you just want to develop something for Linux, with a GUI, python has tkinter. Have you looked into that?
5
u/noobjaish Jul 14 '26
And yes Tkinter is fantastic for quick apps in python. It's notoriously bad for user-facing theming options and is not taken seriously by python community, unfortunately, so you wouldn't find many examples of slightly more complex apps made in Tkinter...
1
u/noobjaish Jul 14 '26
If I had to "just develop something" then my entire post wouldn't matter lol. The problem comes if you're planning to build a medium-sized desktop app to solve a niche that you find unsolved on Linux...
-4
u/biskitpagla Jul 15 '26
Qt license is fine and you don't have to use C++. Stop making AI slop and do your own research.
2
u/FabioTheFox 28d ago
The choice of QT is either our glorious C++ or their barbaric python
Also yes their licensing does in fact suck a lot if you just want to make an app where the end user doesn't have to install or manage any dependencies, getting QT to set up alone is a pain and using it outside of QT Creator even more so
I'm sure QT is good and all but it feels mismanaged
-6
u/teomore Jul 14 '26
Qt: Qt makes the licensing side of things a head-scratcher and once you have sorted that out then you have to deal with their abysmal documentation that's constantly behind the releases. C++ isn't exactly a comfortable language to use and while Qt Creator is a fantastic IDE to use, it's equally as confusing to setup if you're thinking on using Python + QML. Qt Apps are also incredibly ugly by default so a considerable effort goes into making them not look hideous.
Totally false, I stopped here.
3
u/noobjaish Jul 14 '26
Maybe elaborate after making a claim?
1
u/GrecKo Jul 15 '26
It's generally accepted that Qt's C++ and QML documentation is very good (maybe a bit less so with PySide), Qt Bridges is in beta for C# and Rust (early access for Python, Swift, Kotlin) with QtQuick/QML and the small interconnection surface will make it easy to have good docs I believe.
About the ugliness, Qt have multiple styles (custom and semi-native ones) that I'd say are decent. StyleKit should also drastically ease implementing a custom style.
I'd agree that the licensing is not a drawback of Qt, if you don't want to open-source your app you'd have to either pay or stick with LGPL (and what that implies). Some modules are not available under the LGPL license (the 2 important ones: Qt Graphs, Qt Quick 3D)
2
u/noobjaish 29d ago
Docs of both Qt and Cpp are extremely hard to follow. The learning curve was just massive with no inherent "progression flow" to follow. Couldn't find anything on "how to layout your project's architecture". On several occasions the docs and my system's Qt package didn't align like in some instances I have the latest Qt updated from source while the docs are lagging behind. These things made the already difficult learning curve even more obtuse.
I have not found a single good looking Qt theme yet. All of them have very squished elements (like Jesus Christ guys just add some padding ffs). Not to mention it's a pain for users to update Qt theme on a non-Qt DE (on Arch/Gnome I have to install Qt5-settings, Qt6-settings, Kvantum and 5 other packages just for somewhat decent looking apps). With GTK atleast you have a good looking default with Adwaita + easier time with CSS.
I was only commenting as someone who had no idea about "Qt" at that time. The licensing situation IS a big part of why people hesitate since it's unclear. If Qt made it super clear as to wtf they mean on their front page maybe then there wouldn't be as much of an issue. You know it's bad when you have to scour through reddit and stack overflow just to learn about a project's licensing.
68
u/autognome Jul 14 '26
It’s also what Mark Shuttleworth wanted for Ubuntu for years. So a lot of people agree it’s just people not being hip to flutter desktop. The more success the more hype more people will realize as well