At Canonical, we love Flutter and we can’t stop talking about it. Our Flutter developers have been working on bringing support to desktop operating systems since July 2020. This includes our new Ubuntu Desktop installer, built with Flutter, which will be the default user journey in our upcoming 22.04 LTS release. (If you want to see how it’s coming along you can test it out here.)
Continuing our Flutter journey, we recently partnered with Invertase to bring FlutterFire support to Desktop and Dart. In this blog post, we will go over what Flutter’s Firebase announcement means for desktop developers, how to get started with Flutter on Desktop, and where to go to keep an eye on this exciting project!
FlutterFire is a set of official plugins that connect your Flutter application to various Firebase services. Firebase is a collection of tools that provide common services such as analytics, authentication, databases, and push messaging, amongst many other things.
These tools allow developers to leverage common functionality in their Flutter applications, saving development time and effort.
As part of Flutter 2.8, most of these Firebase plugins have now moved from Beta to Stable quality for Android, iOS, web and macOS platforms. This means developers can leverage these services across their target platforms with the confidence that they’ll all ‘just work’. This frees up time for them to focus on the things that make their app unique rather than re-implementing existing services.
You can read more about this work in the latest Flutter blog.
This is where our partnership with Invertase comes in! Whilst macOS is similar enough to iOS to leverage the same Firebase iOS SDK, Windows and Linux have no SDK of their own.
And currently the Firebase C++ SDK only provides basic support for integration with Firebase.
Ultimately we want Flutter developers to have an end-to-end Dart experience across any platform, and the Invertase team has risen to this challenge by developing a pure Dart SDK for Firebase. Right now this includes a Dart only initialisation flow along with a nifty command line tool to help with Firebase initialisation.
This will not only streamline development for Windows and Linux, but also feed back into Flutter’s other platforms to provide a consistent Dart experience across every device.
“We’re really excited to be working with Canonical, using our knowledge of Firebase & Flutter to build the Firebase integrations for Linux & Windows. Our long term vision is for FlutterFire to seamlessly integrate with all of the Flutter supported platforms.”
Elliot Hesp, Invertase CEO
Currently the Invertase team are prioritising firebase_core, a prerequisite to initialise Firebase, followed by firebase_auth, which provides backend services to authenticate via third-party providers such as Facebook, Twitter, Github and Google as well as bespoke account systems. You can view these features using the demo app provided in the next section!
Whilst support for Desktop is still in beta, Flutter developers can enable desktop support today via the following flutter config:
$ flutter config --enable-linux-desktop
For more information on the additional Linux requirements, check out the official documentation here.
In the meantime, the Invertase team have put together an example desktop app based on firebase_core and firebase_auth using the Ubuntu Yaru theme as a guideline for getting started with Firebase.
To get up and running with this app on Ubuntu, follow the instructions below:
$ snap install flutter --classic
$ flutter config --enable-linux-desktop
$ flutter doctor
If everything is OK, you should see something like this:
[✓] Linux toolchain - develop for Linux desktop
cURL, Node.js, and NPM:
$ sudo apt install curl nodejs npm
Firebase tools CLI:
$ curl -sL https://firebase.tools | bash
Melos:
$ flutter pub global activate melos
$ export PATH="$PATH":"$HOME/snap/flutter/common/flutter/.pub-cache/bin"
$ git clone https://github.com/invertase/flutterfire_desktop.git$ $ cd flutterfire_desktop
$ flutter pub global run melos bootstrap
$ flutter pub global run melos run firebase:emulator
$ xdg-open http://localhost:8080
$ cd packages/firebase_auth/firebase_auth_desktop/example
$ flutter run -d linux
It should look something like this:
One of the great things about FlutterFire Desktop is the involvement of the community. We wanted to take a brief moment to shout out Tim Whiting’s work on a dart implementation of cloud_functions which has been a fantastic recent addition to the project!
The GitHub repository for FlutterFire Desktop can be found here.
Follow Invertase for updates on the Firebase Dart SDK.
Check out the Flutter Blog for all the latest news on Flutter.
Finally, don’t forget to keep an eye on the Ubuntu Desktop Discourse for progress on our new Installer, as well as various community Flutter initiatives including Yaru theming and an exploratory Ubuntu Settings App!
One of the most critical gaps in traditional Large Language Models (LLMs) is that they…
Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…
What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…
Wouldn’t it be wonderful to wake up one day with a desire to explore AI…
Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…
Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…