Firebase Tutorial for Flutter: Getting Started |

In this tutorial, you’ll learn how to use Firebase Firestore databases in Flutter by creating a fun app that will help you take care of your pets.

This is a companion discussion topic for the original entry at

Don’t we need to add cloud_firestore: ^0.13.4+2 to flutter dependencies?

There is a section of the article that states:
" In Android Studio open pubspec.yaml and add cloud_firestore: ^0.13.0+1 after flutter_form_builder: ^3.7.2 . Then click Packages get to add the firestore library."

Trying to build after the step Add DataRepository to Main always gave me the same error. I tried to take the finished the project and set it up as well and it still failed. It seemed to be an issue with pods but I could never track down a solution.

Ever run into this?

Thanks for finding this. It took me awhile to figure it out. Turns out that the flutter_form_builder library depended on the flutter_chips_input library which had the problem. I updated the flutter_form_builder library to the latest version and the problem went away. Luckily Android Studio will let you know if the versions can be updated. I have:

flutter_form_builder: ^3.11.5
cloud_firestore: ^0.13.7

** UPDATE: After a day of playing with this I found a fix within 10 minutes of this post!

Problem with flutter_form_builder version. Set to this version. Worked for me with code from the download.

flutter_form_builder: ^3.14.0-alpha.2

*** End Update ***

First let me say this tutorial has the best look/feel of any tutorial I’ve followed (both free and paid)! The work you put into this project shows. Unfortunately I have a similar issues posted above by colesluggett. From the start after downloading and PubGet the app errors. I have updated the form builder as Kevin suggested and further updated to latest available. I cleaned, doctored, removed Podfile.lock and had it rebuild. Continues to error out
– event sent after app closed: {id: 0, progressId: null, message: Running “flutter pub get” in begin…}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib/main.dart on iPhone 11 Pro Max in debug mode…
Running pod install…
Warning: Podfile is out of date
This can cause issues if your application depends on plugins that do not support iOS.
See for details.
If you have local Podfile edits you would like to keep, see for instructions.
To regenerate the Podfile, run:
rm ios/Podfile

Running Xcode build…
Xcode build done. 152.9s
Failed to build iOS app
Error output from Xcode build:


Xcode’s output:

…/…/…/…/…/…/.pub-cache/hosted/ Error: Type ‘RangeSemanticFormatterCallback’ not found.
final RangeSemanticFormatterCallback semanticFormatterCallback;
…/…/…/…/…/…/.pub-cache/hosted/ Error: ‘RangeSemanticFormatterCallback’ isn’t a type.
final RangeSemanticFormatterCallback semanticFormatterCallback;

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

I have found that running flutter clean can help too

Hi, great tutorial.
Any possibility to update or create more tutorials like this about firebase?
I saw many changes in firebase documentation, if I want to use the new version, still exist Document Reference in the code or change?

Your tutorial is great.

I believe I ran into 2 minor problems, unrelated to Firebase.

Problem 1: If you don’t change the pet name or note fields from their previous values, they are over-written with null on “Update”. (Just initialize them in initState())
Problem 2: Adding even one prescription gets you “BOTTOM OVERFLOWED BY X PIXELS”. Just add a SingleChildScrollView.

class _PetDetailFormState extends State {
final DataRepository repository = DataRepository();
final _formKey = GlobalKey();
final dateFormat = DateFormat(‘yyyy-MM-dd’);
String name;
String type;
String notes;

void initState() {
// TODO set type to pet type

name =;
type =;
notes =;


Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: FormBuilder(
key: _formKey,
autovalidateMode: AutovalidateMode.always,
// autovalidate: true,
child: SingleChildScrollView(
padding: EdgeInsets.only(bottom: 15),
child: Column(

Thanks so much for the suggestion. Now that I see those changes, they make total sense.

Any possibility of updating this tutorial? It is very good, but the content is outdated and the samples do not run out of the box. I realize that tech tutorials are moving targets these days as well.

I will let them know. We’ll have to schedule an update

Building the begin project before adding code to it on an M1 MacBook fails with an error message from Xcode:

Error output from Xcode build:

objc[5936]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x203319160) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1201fc2b8). One of the two will be used. Which one is undefined.
objc[5936]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x2033191b0) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1201fc308). One of the two will be used. Which one is undefined.

Any ideas how to solve?

I don’t know if this will solve the problem, but my first thing I try is “flutter clean”, “flutter get” and then try again

Hello for every one;

Thank you so much for your efforts guys, we are appreciating every line you made
so, i have a suggestion for us :
Please if you can make an update these projects to null safety because we are learning from this course a lot.
I hope you take this in consideration, and we can continue learning.
Honestly, this new feature(null safety) is a mind-blowing.
So thank you so much in advance.
We hope we can get response soon.
Thanks for time

This has been updated! Please see:

Hi, I’m new member so apologies if I’m not supposed to post tutorial errors/edit requests here.

So in the book Firestore tutorial for flutter getting started, in the updating the pet model section, I experienced an error with the following code in the pets.dart file:

newPet.reference =;

I had to change it to this code which is also in the final repository folder:

newPet.referenceId =;