Reimagining FlutterFire: Transforming a critical piece of the Flutter ecosystem

PortableText [components.type] is missing "undefined"

Flutter, a project owned by Google that allows developers to build high quality cross-platform applications from a single codebase, is rapidly growing in popularity thanks to a rich ecosystem of third-party packages.

Within that ecosystem is the FlutterFire collection of packages, which integrates Flutter with the services that Firebase provides, such as analytics, databases, push notifications, cloud storage and many more.

FlutterFire is used in most of today's Flutter applications and is also one of the most technically complex packages on the market, supporting Android, iOS, Web and Windows platforms. This is why Invertase is proud to fully manage the FlutterFire suite of packages. Our responsibilities include development, maintenance and support.

A screenshot of the Flutter Firebase Git Repository on GitHub.
The FlutterFire GitHub Repository -

FlutterFire development

FlutterFire has come a long way since its beginnings in 2017 when it was a small (unofficial) project built and maintained by Googlers. The project was supported on a 'best-effort basis', covering a subset of the 17 services that Firebase offers.

However, as Flutter grew in popularity so did the demand for FlutterFire support. Firefighting user issues and bugs, developing new features, and providing documentation and releases require significant investment in both resources and skills. When the back-up wasn't forthcoming, users began questioning why Google wasn't supporting its own flagship products.

Of course, it wasn't quite that simple. Building such an integration requires significant investment in full time resources, and also requires deep understanding of the Flutter and the multiplatform Firebase software development kits (SDKs).

A screenshot of the React Native Firebase Git Repository on GitHub.
The React Native Firebase GitHub Repository -

During this time, Invertase was already partnering with Google to develop the React Native Firebase (RNFB) packages - a similar integration to FlutterFire but based on React Native, which is a competitor to Flutter in the cross-platform development space.

React Native Firebase is a much older project than FlutterFire. Thanks to the Invertase team's years of experience handling the various quirks and discrepancies of the Firebase SDKs, the project is a well-oiled machine with fully automated releases, testing infrastructure and more. And it needs to be, considering it's downloaded over 1.6 million times per month.

Understanding the complexities and importance of FlutterFire to the Flutter ecosystem, Google reached out to Invertase and requested the company perform the same miracles it had achieved with RNFB. Google wanted Invertase to reimagine what FluterFire could be, bringing it up to the high standards expected of a Google product.

Invertase accepted the challenge and started its exciting journey into the Flutter ecosystem.

What were Google's requirements for FlutterFire?

Google wanted Invertase to overhaul the collection of existing FlutterFire packages and bring them up to the high standards expected of Google products. Invertase's development work got underway in the year 2020, with the aim of achieving the following:

Although each demand appears straight-forward, the solutions required to implement them are highly complex in nature.

What were the challenges of the project?

The first challenge was a significant one: nobody at Invertase had previously written a line of Dart - the programming language that powers Flutter. So the team had to learn it, fast.

A priority in the early days of FlutterFire's road to redemption was triaging all outstanding issues and pull requests, of which there were over 1,000! These ranged from minor bugs to show-stopping missing feature requests. Another massive challenge of the project was establishing support for all possible platforms, which Flutter itself supports (Android, iOS, Web, Windows & Linux). At the time, FlutterFire only supported Android & iOS.

However, the above was a secondary issue. In order to support all platforms, the project would need to adopt the "federated plugin" architecture, which essentially required a full rewrite of the existing implementation. The public API was also inconsistent, bearing little resemblance to the existing Firebase SDKs.

Screenshot of the FlutterFire documentation website
The original FlutterFire documentation website (before moving to official Firebase documentation)

Other challenges such as testing, documentation website and automation were complex too, however Invertase's previous experience with React Native Firebase smoothened the processes.

How did Invertase achieve its objectives?

Google's FlutterFire project presented Invertase with extremely complicated obstacles that required innovative thinking to overcome.

For example, to speed up development and the launches of update releases, Invertase's team of engineers built a custom tool to dramatically improve developer workflow. This became known as the game-changing Melos tool, which is now a staple part of the Dart and Flutter communities. Learn more about Melos here.

To deliver on their promises to Google, the Invertase team were required to perform deep-dives into a complex and unwieldy codebase, including rewriting entire portions of code and ensuring that the public API which customers interact with worked seamlessly across six different programming languages.

The result

Invertase's work on FlutterFire had a profound impact on the entire Flutter ecosystem. So much so, FlutterFire graduated from being a third-party package to an officially supported Firebase SDK.

Thanks to the Invertase team, Google now has a higher quality product that is more stable and far more likely to be trusted and adopted by customers. This is a testament to the sheer amount of effort invested by the Invertase team in its development, as well as the high level of engineering they achieved.

Screenshot of Flutter on the Firebase website
The Flutter SDK is now an officially supported Firebase SDK

Today, FlutterFire issues are down over 90% and it supports all available Firebase services - across all platforms. Process improvements from Invertase have also led to a fully automated CI/CD system with full test coverage, improving stability further still, and external contributors can be confident any changes they make are rigorously tested.

The combined suite of 50+ individual Flutter packages also undergoes weekly releases thanks to Invertase's automation systems and the Melos tool it created for the project.