Flutter in Ubuntu: What are the next steps?

As a fan of Dart and Flutter’s development experience, I’m excited about future possibilities with Flutter being a first class choice for making many kind of apps.

I understand Canonical is working together with Google in some respects. I don’t know the extent of their goals, but I thought this would be a good place to discuss what Ubuntu app developers would like to see to make this the best option it can be for application developers.

I’m interested in hearing:

  • What’s missing to make X type of app?
  • What could be done differently?
  • What else would make it great?
  • What are Canonical/Ubuntu’s official goals and opinions on Flutter use?

If there are existing issues in flutter’s github or other useful conversations, please link.

Note: Please refrain from debating how much they hate/love dart/flutter vs X, or comparing performance, etc.

5 Likes

Desktop integration and appearance

  • Client-side decoration support

    • Adding CSD support would help people utilize the real-estate better and look close to many Ubuntu apps that use CSDs and just generally give developers more options.
    • Open issue on Flutter GitHub for support
  • dbusmenu support

    • I think being able to create and export menus for more advance applications would be really great to integrate with global menus from KDE/unity/etc and also allow menu searching which is to be the bigger benefit to me.
    • I know flutter already sends the menu to MacOS’s global menu, so this might already be a thing? see video
  • Yara / Adwaita widgets / theme

    • edit: in progress see comment below
3 Likes

This is already being developed as a separate, 100% reusable project, and published on pub.dev.

1 Like

Very cool thanks for the links

@sophie-w said in his post about Flutter wayland work, that by default Flutter on wayland will use CSDs.

Does this mean Flutter will hook into a GTK headerbar, or will Flutter on wayland draw its own titlebar with Yaru themed widgets
(or even with other widgets for a custom looking app wanting to draw close/min/max buttons, like most popular (simple) commercial apps today are doing (like steam)

I think they meant the former, but definitely would be a cool add later to lose dependence on GTK titlebars altogether and let Flutter draw the titlebar itself as an option. For instance, what if people want to make apps with an ‘immersive mode’ like when lollipop can show the album art without the titlebar. I love this as it look nice and I can have it stay on top of other windows as a little desktop widget almost while working.

3 Likes

Awesome Canonical and Ubuntu shoutout on Flutter 2.0 announcement on the Google Dev blog.
Excerpt:

“Beyond traditional mobile devices and the web, Flutter is increasingly stretching out to other device types, and we highlighted three partnerships in today’s keynote that demonstrate Flutter’s portability.
To start with, Canonical is partnering with us to bring Flutter to desktop, with engineers contributing code to support development and deployment on Linux. During today’s event, the Ubuntu team showed an early demo of their new installer app that was rewritten with Flutter. For Canonical, it is critical that they can deliver rock-solid yet beautiful experiences on a huge variety of hardware configurations. Moving forward, Flutter is the default choice for future desktop and mobile apps created by Canonical.

As far as the bolded last sentence, I’m not sure if that was an assumptive statement or the Canonical team actually hinted at this.

Anyone that works on that team able to comment on this and any exciting future ideas for Flutter ubuntu development?

2 Likes

@kenvandine mentioned those words in the Flutter Engage keynote

https://www.youtube.com/watch?v=B0YnCOkMits

2 Likes

Thanks for link. Here’s a link directly to Ken VanDine’s section, although for those interested in USING flutter, I recommend watching it all on the link @lucyllewy provided above.

Flutter Engage Keynote: Canonical section notes

  • Want Linux to be a first class attractive choice for Flutter developers
  • Linux desktop app support is in a shape that it can start being used today already with just the basics in place, but this is just the beginning.
  • “Flutter is the default choice for future desktop and mobile apps created by Canonical”

Canonical contributions so far

  • Enabled Flutter for Linux
  • Published Flutter SDK as snap for easy install and setup of dev environment. (for mobile,web,desktop)
  • Published Yaru theming package for desktop theming and consistency
    • Work ongoing

Canonical working on

  • Full Multi-window Support to all platforms Flutter for desktop supports
    • Working with Flutter @ Google on spec, and will start the engineering soon
  • Working on enabling popular plug-in support for Linux/desktop
    • Firebase, Bluetooth, Network Connectivity, Desktop Notifications, and more

Random observations

  • Cool Groovy Gorilla shirt
  • I think I heard him pronounce Ubuntu, “Yoobuhntoo” “Yooboontoo” AND “Oobuhntoo”. I think" Ooboontoo" is correct, but I appreciate the variety to represent more of the viewers :innocent:.
5 Likes

Going to start putting weekly desktop team updates related to Flutter here so people can see progression related to Flutter from a single place. And also add any comments related to those updates since comments can’t/shouldn’t be added to the updates thread.

Desktop Team’s Flutter Updates - Monday 1st March 2021

robert.ancell

marcustomlinson

Older Desktop team threads that mention Flutter (from this year)

** Will add notes from current active thread when it becomes static and the next thread is created

1 Like

Is there a Flutter app in the Snap Store now, even a sample app, so we can try it out on Ubuntu?

1 Like
$ snap find flutter
...

shows a few …

4 Likes

There are several on the snap store like Flokk. Fluffychat is even on Flathub that uses flutter. However, none currently utilize the full extent of what is planned and none of them use the yaru theme/widgets package. In the future there will be for all intents and purposes native desktop applications using Flutter that can follow Ubuntu design guidelines with good integration in the desktop, but there is still integration work. At least that is how I am perceiving the communications thus far

1 Like

Flutter mentions in Desktop Team Updates - Monday 8th March 2021

robert.ancell

  • Added null-safety support to snapd.dart .
  • Working on Linux bluetooth support in flutter_reactive_ble .
  • Updated dbus.dart, desktop_notifications.dart, nm.dart, upower.dart and udisks.dart to use Dart 1.12 final now it’s released, adding null safety support where required.

marcustomlinson

1 Like

The Flutter Linux shell currently uses a GtkHeaderBar except when running on X11 outside of GNOME Shell. This fallback was added because people were having issues in other window managers, e.g. those that use tiling. Dart applications should look native by default, which is why we enable the header bar.

There’s no Dart APIs that allow you to add widgets to the header bar, but you have some options. You can write a Dart plugin (in C++) that can access all the GTK APIs. In this way you could write Dart code that calls into the C++ code to change the widgets in the heaeder bar. You can also use FFI to access C APIs from Dart code. Alternatively, the default Linux application is a template, and can be modified as you need (adding things to the headerbar or removing it entirely).

I don’t believe Flutter supports undecorated windows (i.e. decorations done by Flutter), but that seems like an API that could be proposed. There is work currently underway on supporting multiple windows, which is bringing more desktop concepts to Flutter.

In short, all these things are possible, and just require more work the further you go from the default.

5 Likes

Thanks for this insight! Very interesting. I think in the long run, the apps I’m interested in making would benefit from being able to utilize undecorated windows and have an “AppBar”-like implementation that mimicked a GTK headerbar. I think that would also make development of familiar looking (Yaru+GTK) apps more accessible for devs coming from flutter for mobile, or interested in keeping as much pure dart as possible.

Example: Creating a file manager put in a breadcrumb using https://pub.dev/packages/flutter_breadcrumb in the headerbar

Regardless, very interested in trying out the options you described.

On the topic of multi-window, has anyone ever brought up the possibility of… I guess I’d call them “dock points”, or areas where a widget could be docked/moved and reactive to different spots, and also pulled out to work as a floating window? I’m not sure how it would even work with the widget tree but guessing it should be technically possible with just multi-window existing at all, even if there’s no easy implementation.

Example: Simple pixel art creator where you can re-arrage or even tab widgets to cater to the artist.

1 Like

Heads up for custom client-side decorations there is now linux support for this third party solution. It’s not exactly what many are asking for but it’s a lot better than nothing.

bitsdojo_window

2 Likes

Is wayland and touch doing ok with flutter and gnome?

Pretty cool project here if you want your app to look like a GNOME app

https://github.com/jesusrp98/flutter_gtk

1 Like