
Flutter for Linux - CSharpRon
https://snapcraft.io/blog/canonical-enables-linux-desktop-app-support-with-flutter
======
axegon_
I'm actually a great fan of flutter and imo it is the best cross-platform
solution out there. Probably except for web: though it produces very good
result performance-wise, the end result is never really "web" and doesn't act
like traditional web. As for desktop applications(whether it be windows, linux
or mac), it seems like it's too mobile-oriented. I see great potential for
simple solutions like self-service operations where you need a basic UI and it
would be great if it could easily target platforms like raspberry pi (arm
processors running Linux). But at the moment, while possible, it is a very
painful thing to tackle and I wouldn't rely on something like that for an end
product. I would assume that this is why google is working on fuchsia but way
too few devices are supported. And neither of them is cheap(which is what
could be a game changer, going back to the raspberry pi).

~~~
RivieraKid
I've been using Flutter in the last few months and agree. It's the best multi-
platform solution for _mobile_ , although it still doesn't match native
behavior and performance, it only gets close.

On the web it's DOA for most use cases - it's just a canvas, so scrolling,
text selection, shadow rendering, etc. is custom, doesn't feel native and must
be downloaded and compiled.

It can have a future on desktop. One "cultural" obstacle is that the de facto
default widget system is Material, which is simply a wrong approach to desktop
UI.

~~~
akerro
>It's the best multi-platform solution for mobile

They announced beta version for Windows in the last few weeks, so what to
expect? I've been using it on linux desktop for 4 months so far, there were
many problems, but it's absolutely the best framework so far. It's miles ahead
of Qt (which I've been programming in since 2010). Dart and flutter are just
years ahead of Java, C#, Qt and React Native in terms of positive programmer
experience, productivity, good looking UI. There are so many bad things to say
too, but all I can think about are only due to immature ecosystem, but that's
changing literally daily.

~~~
brnt
Hoe is it ahead of Qt (on desktop)?

~~~
heavyset_go
I'm wondering this, too. While I enjoy Flutter, it doesn't hold a candle to
the extensive Qt library and QML.

~~~
pjmlp
Specially to the graphical designer tools, or the quality of third party
component libraries.

------
rst
So, this makes Flutter apps available through Canonical's Snap store... which
is Ubuntu-mostly right now, and controversial enough that the top item on the
HN front page as I write is about an Ubuntu derivative (Linux Mint) explicitly
dropping support for it.
[https://news.ycombinator.com/item?id=23771847](https://news.ycombinator.com/item?id=23771847)

~~~
canada_dry
Until SNAP gives me full control (and not just: you can opt-out) over
updates/upgrades they're a non-starter.

~~~
kelvie
Also it's ridiculously annoying debugging issues with them, or finding out
what source code compiled into a particular snap.

Even with docker hub I can find the sourcecode easily linked 99% of the time.

~~~
galgalesh
Yeah, it would be useful to have a metadata field "packaging repository" or
something.

Snaps built from GitHub with snapcraft.io include a manifest and the build
recipe in the `meta` folder in the root of the snap. This includes all the
info about the source code and allow you to reproduce it. Publishers can
enable this on their own build infrastructure using an environment variable.

Many snaps also link to the source repository in the "contact <publisher>"
link.

------
armytricks
Having used Flutter extensively since I was first introduced to it 9 months
ago, I can say that it is an absolute joy to use and build interfaces with. An
easier way to install the Flutter SDK on linux is only good news and I hope it
gets more developers to adopt it.

~~~
programmarchy
Agree, Flutter is top notch. I've had trouble pitching it as a technical
solution, though. For one, I think word is out that Google will kill projects
mercilessly, and there's an odd dynamic between the promotion Flutter and
Kotlin/AndroidX. Generally, Kotlin comes out on top as the "safer" choice.

It's a shame, though, because the primary advantage I see with Flutter is its
superior UI framework. It's leagues better than the AndroidX compatibility
lasagna, in terms of architecture and DX. So it really stands out as a cross
platform solution not just across iOS and Android, but especially across the
Android ecosystem itself.

------
awill
Google needs to release desktop apps in Flutter (Youtube Music, Chat, Meet
etc..). a Webapp is fine for occasional use, but Google Chat can't compete
with Slack without a real app.

~~~
kelnos
I uninstalled Slack's desktop "app" a long time ago and never looked back. The
browser version is much better, and doesn't require me to have an extra (often
buggy, in my experience) browser instance open in order to use it.

Calling it an "app" is somewhat laughable, since it's just their website
packaged up in a standalone web browser, plus a minimal amount of platform-
specific glue.

~~~
tudorconstantin
I am not able to screenshare in slack from browser on Linux, only from the
electron app.

------
eklavya
I am so excited about flutter ecosystem. Hopefully linux gets first class
beautiful native apps now. I also hope against hope that qt is officially
supported as a backend so KDE is not left out.

~~~
andrepd
Judging by the example in TFA, we must have very different conceptions of what
"beautiful" means. That is an atrocious application.

* Ungodly amounts of whitespace (seriously, look at that sidebar, look at that search bar. WHY? too much optimisation for what "looks good on a screenshot", maybe?)

* Undecipherable symbols where there's _plenty of f#cking space to write labels god damn it_

* I bet bad/nonexistant keyboard support (remember alt-* to navigate menus?)

* Ugly to look at (subjective)

~~~
Spivak
You do know that none of that is really do do with Flutter, right? Like you're
just taking it out on the designers of Flock.

~~~
ocdtrekkie
This isn't true: Google preloads their design conceptions, namely Material,
into Flutter at the ground level, and Material is a terrible set of UI
patterns, such as the ones the parent comment was complaining about.

~~~
satvikpendem
You don't have to use the material design stuff, you can just make your own
components, all custom, just as you would on the web. Just replace MaterialApp
with WidgetsApp at the root of the application tree.

~~~
ocdtrekkie
You don't have to, but it is the default, which means it sets the standard of
design there. Unsurprisingly, most things you see made with Flutter tend to
either be or be similar to Material.

------
me551ah
The future of cross platform desktop development looks bright. Microsoft is
coming up with .NET 6 and Google has flutter. I just hope that these
frameworks can replace bulky electron apps.

~~~
k__
Revery also looks nice.

I wish they had more funding, tho. I find Reason/OCaml more compelling than
Dart.

~~~
sly010
How is OCaml's multithreading story? Google says it's basically GIL-ed.

~~~
blandflakes
Simultaneously in a state of having-been vaporware and making real progress
towards being merged to master:

[https://discuss.ocaml.org/t/multicore-ocaml-
june-2020/6047](https://discuss.ocaml.org/t/multicore-ocaml-june-2020/6047)

------
harikb
I have a request for all the Flutter folks/fans - it would be great if you all
can say something about how you can get over / stay sane with the staircase
looking nesting of code blocks and how you manage to keep it all in your head
to navigate the code base.

I started my career writing single threaded Palm OS apps (64k limit) - there
was like 10 possible widgets with 5 possible events on each widget and rest of
it was application code. Mobile app development is a different beast now. Yes,
I sound like old-man-yelling-at-cloud. Is this table-stakes for all UI and App
development?

~~~
heavyset_go
> _it would be great if you all can say something about how you can get over /
> stay sane with the staircase looking nesting of code blocks and how you
> manage to keep it all in your head to navigate the code base._

The same way you would in any other code base, with the ample use of names and
modules, and breaking nested components and logic into their own classes and
functions.

The problem is that it requires discipline, or at least a standard style
guide, to adhere to. It's similar to JavaScript in that regard, where bad
practices can seemingly be ignored or even encouraged.

~~~
cutler
Trouble is that in most Flutter code the widget staircase is idiomatic. Swift
UI also seems to have chosen the same path.

~~~
solarkraft
I don't really see the issue. Widget layouts are trees. Why shouldn't you
represent them as such in your declarative code?

------
hexo
From the screenshots and gifs over there I can tell that someone is again
forcing people to look at 1) animations 2) grey fonts instead of black and
they are even bragging about it being beautiful. These also tend to enormously
waste screen space.

Are especially those two things configurable by user? I mean - there has to be
no animations at all (why does anyone insist on animating theme change? that
is just ridiculous), and black text, not grey. If not, that is complete deal
breaker. Please tell me I'm wrong and one can configure everything there.

Single word: accessibility. More words: normal accessibility without needing
to re-set whole system to be "accessible" just because one app developer can't
behave.

~~~
solarkraft
Non-animated changed are offensive to me. Humans are built to track moving
things, not a thing instantly disappearing at one point and another, similar
looking thing instantly appearing at another place, with no context telling
you whether it's actually the same object. This gets worse the larger the
state change is.

Similarly information overload is an issue, but of course too little
information is as well. That's on the designers, though, you can certainly
build information dense apps with Flutter if you want to.

From what I can tell there seems to be a platform multiplier for animations to
enable slow motion mode (an important tool for developing good transitions),
which I suppose you could just set to 0. And if it doesn't it's just on the
developer again.

Basically: I won't deny that it can certainly influence decisions (actually I
think it's an important thing to consider), but ultimately it's not _really_
the plattform's fault if a developer decides to make an app you don't like.

~~~
hexo
Yes, animations really influence decisions. Mainly about using the particular
piece of software at all (animations are no go for me and a lot of other
people).

Some folks do not have the luxury to spend hundreds of miliseconds to seconds
each time they do some action (and believe me or not, they do A LOT of actions
per day).

Some people are actually using computers to do stuff as fast as possible so
they have fast computers. Having fast computer doesnt automatically mean
someone is willing to spend those resources on some eye candy.

Stuff moving around actually increases information overload as it adds to
state one needs to track (moving object). To some folks this this even causes
problems from medical reasons.

When it comes to information density, this should actually be up to user as
well (lets call it compact mode for example) but at least to me it is not as
critical as movements. Best would be being able to set "margin sizes" or
something like that. And even that should be completely trivial given that no
one should really write fixed-widget-position applications these days (i
havent done so in ages, i'm using vertical/horizontal containers and spacers).

As should be application color theme as we are/were used to for a loooong
time. But I understand that it isn't something Windows users are aware of,
since each and every program there forces you to look at completely different
interface that behaves in other way and has other ux logic.

I do think we can both agree that being able to stop all and every animation
(including fading and whatever else in this category) is very important for
user inclusion and accessibility. And since (as you said) slowing those down
is needed for their development, "disabling" that feature should already be
trivial. It just has to be available to user. Otherwise it's just an arrogant
negligence and showing over-supremacy by "i know better what you like to look
at".

------
avilesj
I'm excited to have another contender on multi platform apps space but in the
case of Flutter for desktop I just wonder about the RAM consumption compared
to Electron.

~~~
programmarchy
Dart compiles to native machine code, so unlike Electron doesn't need to host
an interpreter, which tends to aggressively allocate memory. Should be much
friendlier on RAM.

------
CSharpRon
Great news for sure. There's a React Native application that I am maintaining;
it's not too complex but I would love to give a rewrite a try with Flutter and
see how it does on Ubuntu.

------
haolez
For my usage, Flutter is a no-go for web development for the same reason as
Qt: it's just a canvas, so text selection, accessibility, etc doesn't work
nicely or at all.

------
heavyset_go
Having recently chosen a Qt stack for cross-platform desktop development over
Electron, I'm happy to see that Flutter is now a real contender in this space.

I'm curious about Flutter and Dart bindings and calling interfaces for other
languages. If you can integrate a Flutter front end with a back end language
of your choice, that would change a lot of things for the better. The only
reactive UI offerings for cross-platform desktop development with multiple
language bindings are QML, which is great, or Electron with React, which is
not so great if you want to use anything but JavaScript for your back end.

------
kelnos
> _Canonical is making it very easy for application developers to publish
> their apps for Linux users via the Snap Store, the app store for Linux._

Ugh. No, Canonical, no matter how much you'd like it to be, the Snap Store is
not, and will never be, "the app store for Linux". The last thing the Linux
community wants or needs is a closed-source[0], walled-garden approach to
distributing applications.

[0] For the pedants out there: yes, you can create Snaps with open tools, but
the only Snap server implementation is closed.

------
oaiey
Microsoft really has to speed up the Xamarin.Forms / Maui development. The
omission of Linux is a really a pity.

~~~
jayd16
They said they'll have a preview by the end of the year. I'm excited to see it
but I'd rather they do it right instead of right now.

~~~
CSharpRon
TIL about Maui. From my light researching, it looks like any Linux
implementation of Maui will be community-led instead of Microsoft led like the
Windows and MacOS implementations.

[https://github.com/dotnet/maui](https://github.com/dotnet/maui)

------
etse
What are some high quality non-Material, non-Cupertino themes that any Flutter
(mobile) developers can recommend?

Material is well done, except I really don't like the actual design. Cupertino
looks more like iOS 7 than iOS 14 and lacks something…

------
mixmastamyk
Good to see. I've been wanting to use Flutter for a Linux-based appliance but
it still needed a lot of work on that front until recently. If there was a
bittorrent library in Dart as well I'd be off to the races.

Up until this time I've been using Kivy for the application, but it has a ton
of issues and doesn't seem to receive much investment or support, even if you
wave money around.

------
olingern
I haven’t dug into this, but I wonder what compatibility this will have with
window managers, like i3

~~~
knotty66
I've just tested on regular i3 (no Sway).

Works pretty well until you start moving or resizing the window but once I did
it crashed the app a couple of times.

I also couldn't start the app fullscreen on a 4K display - it just displayed a
small black rectangle. Other than that it felt fast and smooth.

It is an alpha though, so I thought it was promising nonetheless.

------
fungos
Flutter: yay!

Snap: nope!

Anyway, hopefully this will cause a push for flutter support on other distros
that are snap free.

~~~
timsneath
It's worth noting that Ubuntu support and Snap support are orthogonal. The
Flutter work here generates standard ELF binaries that can be distributed
outside of Snap, and Canonical's contributions to create a high-quality
desktop embedder for Linux are applicable across all distros.

------
reddotX
flutter on Ubuntu 20.04
[https://www.youtube.com/watch?v=MnXKtwKNAB4](https://www.youtube.com/watch?v=MnXKtwKNAB4)

flutter create flutter run

done

------
Dowwie
see the flutter-rust ffi: [https://github.com/brickpop/flutter-rust-
ffi](https://github.com/brickpop/flutter-rust-ffi)

Is anyone considering writing flutter + rust desktop apps in linux?

------
g5becks
Really wish Dart was more useful for server development. There’s a lot of
missing packages that no one seems to be interested in writing right now
though.

~~~
mleonhard
That's normal for Google APIs. Only interesting stuff gets done. Boring
problems stick around forever, wasting millions of user engineer hours.

Examples:

\- Chain.capture() not working in tests [https://github.com/dart-
lang/stack_trace/issues/50](https://github.com/dart-
lang/stack_trace/issues/50)

\- Document exceptions thrown [https://github.com/dart-
lang/http/issues/245](https://github.com/dart-lang/http/issues/245)

\- It's difficult to find content using normal browser find
[https://github.com/dart-lang/dartdoc/issues/2131](https://github.com/dart-
lang/dartdoc/issues/2131)

\- SecurityContext.setTrustedCertificatesBytes fails with BAD_PKCS12_DATA
[https://github.com/flutter/flutter/issues/39190](https://github.com/flutter/flutter/issues/39190)

\- Add remote port information to Socket errors (2013!)
[https://github.com/dart-lang/sdk/issues/12693](https://github.com/dart-
lang/sdk/issues/12693)

\- setTrustedCertificates doesn't work. Causes HandshakeException all the time
[https://github.com/dart-lang/sdk/issues/35462](https://github.com/dart-
lang/sdk/issues/35462)

\- badCertificateCallback is called with issuer certificate instead of leaf
certificate for LetsEncrypt published certificate [https://github.com/dart-
lang/sdk/issues/39425](https://github.com/dart-lang/sdk/issues/39425)

\- No way to preload Image from assets before first builder (needed for smooth
splash screen with images)
[https://github.com/flutter/flutter/issues/26127](https://github.com/flutter/flutter/issues/26127)

\- Provide function to get the current system timezone name
[https://github.com/dart-lang/sdk/issues/21758](https://github.com/dart-
lang/sdk/issues/21758)

\- Create an easy and consistent Exception base class
[https://github.com/dart-lang/sdk/issues/2909](https://github.com/dart-
lang/sdk/issues/2909)

\- Google please provide a Location module
[https://github.com/flutter/flutter/issues/31453](https://github.com/flutter/flutter/issues/31453)

\- Widgets inserted in MaterialApp Navigator Overlay don't get theme
[https://github.com/flutter/flutter/issues/39379](https://github.com/flutter/flutter/issues/39379)

\- [firebase_messaging] PHONE_REGISTRATION_ERROR on Android API 18 with Google
APIs
[https://github.com/FirebaseExtended/flutterfire/issues/1471](https://github.com/FirebaseExtended/flutterfire/issues/1471)

\- Use layer style for colors in Design Kit for Sketch
[https://github.com/material-components/material-
components/i...](https://github.com/material-components/material-
components/issues/74)

------
ZeroCool2u
I'm a huge fan of Flutter for a number of reasons, but I just tried the demo
app Flokk and it doesn't work at all on vanilla Ubuntu 20.04 running Wayland.
They actually had this working over a year ago on desktop, not sure how such a
massive regression like this made it through.

------
topspin
Interesting that Flutter "Desktop support" exists for macOS and Linux, but not
Windows.

~~~
kjksf
It does exist for Windows (i.e. I compiled and ran Flutter app on Windows).

It's just slightly behind macOS and Linux in maturity.

In general desktop support is "early alpha" quality.

I'm hoping that in a year or two Flutter will be a solid option for
mac/linux/windows desktop apps.

For now we have to accept that it's an alpha quality software.

------
sgt
Does this work well on RPi 4?

------
paulcarroty
Good news, but all depends how much Google interested in Linux desktop support
in Flutter. I'm highly skeptical due to their "hyper activity" in Linux
desktop niche.

------
thomascgalvin
Does Flutter have a native HTML widget yet? It didn't when I first started
poking around with Flutter, and a quick Google doesn't reveal anything first-
party.

~~~
mnazim
A number of packages provide webview, which can be used to render html pages.

~~~
ellsthrow
These still aren't "production" ready yet though unfortunately e.g. they don't
currently support keyboard input

------
Rapzid
What's the story for extending a flutter application dynamically? Is it
possible to write and load plugins for them?

------
amelius
Wouldn't it be possible to install Flutter with the usual ./configure; make?

------
colesantiago
What is the off chance that Google will drop Flutter?

~~~
sudhirj
This matters only if Flutter is a closed source project – but it's not. You
can fork it on Github right now and continue working on it even if Google
pulls its engineers off. I'd assume that those of us (and there seem be a lot
of people) invested in it will continue working on it.

~~~
heavyset_go
> _This matters only if Flutter is a closed source project – but it 's not_

It certainly matters. Without a team of dedicated developers maintaining the
project, the APIs it depends on will become deprecated, and it'll slowly
become unusable.

Flutter touches a lot of APIs across many platforms. It's a complicated
project that needs to support virtually every popular operating system in a
visually and behaviorally consistent way.

Flutter also depends on Dart's maintenance, which is another project without
significant open-source contributor activity outside of Google employees.

> _I 'd assume that those of us (and there seem be a lot of people) invested
> in it will continue working on it._

Having contributed fixes to Flutter and Dart, Google does not go out of their
way to build an open-source contributor community around the projects. I would
be surprised to learn that any significant support is provided by open-source
contributors to Flutter or Dart.

------
skratlo
Yay, Macromedia Flash for desktop is here, made in Google, Dart instead of
ActionScript, wow, just wow.

~~~
yjftsjthsd-h
I assume that this is meant as a criticism, but Flash was quite good at easy-
to-make portable graphical apps; they had massive security issues and some
lack of polish, but there's a reason why Flash dominated its era. (Also,
"Macromedia Flash for desktop" was already a thing, no?) So yeah, "Flash but
modern and safe" would be a pretty strong selling point.

~~~
snodnipper
Flash remains the most productive UI development environment I have had over
the past twenty years. Getting graphical apps working on all major platforms
is a fabulous achievement by the Flutter folks.

I have no love for what Android has become and where Kotlin is going. The web
today feels like a PDF...huge amounts of movement but not necessarily
progress.

I hope more than anything that Flutter continues to gain traction. To my mind
it is perfectly reasonable for next generation tech to write to the canvas
with the latest widgets as long as there is good accessibility support.

