Adding a Real-time Database to a Flutter application with Firebase

What Will I Learn?

  • You will learn how to add a Firebase Store to a Flutter application
  • You will learn how to add Listeners to the Firebase database
  • You will learn how to dynamically change the state of your application based on the state of the database
  • You will learn how to use native and platform methods to implement Firebase in Flutter

Requirements

Difficulty

  • Intermediate

Description

In this Flutter video tutorial, we look at how we can implement and use Firebase inside of a flutter application. Firebase can be accessed through flutter by way of Android, iOS or through a hybrid approach. Currently, the plugins do not allow for a fully native implementation simply because the plugins and framework lack maturity, however, the setup is not as intensive as it would be in a native Android or iOS application.

Firebase is a cloud platform document storage realtime database. We can use it in Flutter to store, access, update and delete data in realtime in a way that is lightweight and fairly intuitive. Firebase can also be used for authentication, file-storage, and other use cases; but our application simply uses it as a basic data storage tool. We have a simple form with two input boxes. When the user writes text into these input boxes, the data gets sent into an Object which then pushes the data into our Firebase data store in a Json like format. We use stream listeners to see when the data has been changed or added to our firebase data storage and then we change the state of our application in response to these events. We also fetch the data from these streams and push it into a list which then updates our Firebase animated list widget.

The source code for this project can be found here

Firebase can be found here

Video Tutorial

Curriculum



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
3 columns
2 columns
1 column
4 Comments