Flutter + Firestore: You may be using it wrong.

Michel Feinstein
Flutter Community
Published in
10 min readAug 11, 2020

--

Cloud Firestore can be very powerful when coupled with Flutter, but also tricky for Production-Ready Apps where a good architecture is paramount.

Flutter + Firestore: The whole is greater than the sum of its parts

Firebase Cloud Firestore’s Flutter integration is nothing short of amazing. It takes advantage of Dart’s language features, enabling fast development cycles with almost zero backend code. But as Uncle Ben once said: “With great power comes great responsibility” or in our case: All that flexibility can come at a price.

Production-Ready Apps need to be robust, so regular code maintenance or feature updates won’t easily bring along unnoticed bugs. The key to achieve it is following best practices. Adopting tried-and-true architectures and sound design patterns, will provide a much more pleasant experience to your users.

This article explores why most examples provided on Firestore’s “Tutorials” and “Quick Starts” don’t follow these best practices, so you shouldn’t strictly copy them, but instead extract the essence of what they are trying to teach.

Note: This article is meant for developers already familiarized with Flutter and Firebase Cloud Firestore. If you aren’t there yet, I suggest you hone your skills a bit more and then come back here later.

The Problem

--

--

Michel Feinstein
Flutter Community

Flutter Tech Lead @ BTG Pactual Digital. InfoSec enthusiast. Electronics hobbyist.