This course is available as part of the raywenderlich.com Professional subscription. To learn more click here
Pro

Beginning Firebase with Flutter

Jan 25 2022 · Video Course (38 mins) · Intermediate

When writing mobile apps, saving the data users input is critical. You can save the data locally, but then you can’t save it permanently or share it with others. If you want to share your data, you need to save it in the cloud. One of the easiest solutions is Google’s Firebase Firestore database. Firestore is a NoSQL style database. Unlike traditional table-based databases that require much work to insert data, you save JSON blobs to collections.

Version

  • Dart 2.14.4, Flutter 2.5.3, Android Studio 4

Flutter Firebase

In this episode, create a firebase account and register a new firebase project for your PetMedical App. Also, get an introduction to all things that you are going to learn in this course as well as the prequisites.

1

Before you use Cloud Firestore or other Firebase services, you will need to initialize your Firebase App. In this episode you are going to add the firebase core plugin along with the cloud firestore plugin to your Flutter project.

2

In the previous episode you learned about the differences between firestore and realtime database. Now you will create your firestore database and start it in test mode and then add it to your dependencies.

3

To retrieve your data from Firestore, you need to create two model classes where you’ll put the data. In this episode, use Android Studio to create to model classes: Vaccination and Pet.

4

Now that your models are ready you will need to create a repository class to retrieve and save data. Remember that it is considered a best practice to isolate your connection to your data sources as much as possible.

5

Streams are a sequence of asynchronous data that sends when ready. Firestore sends updates to your list of pets when someone else adds or modifies a pet. In this episode, use a stream in your main file to listen for updates of your list of pets in your firestore database.

6

In this episode, build the last screen of your app which is going to show the details of a particular Pet. You’ll also get some links in case you want to learn more.

7

Who is this for?

Intermediate level Android developers who want to learn about the basics of Google’s Firebase Firestore database. In particular, this course will be useful if you want to learn how to use the Firestore API in your Flutter projects.

Covered concepts

  • Create a new Firebase project.
  • Configure a Firestore database.
  • Use and create collections.
  • Add Firebase dependencies to your Flutter project.
  • Use streams.
  • Create models and repositories.

Contributors

Comments