Skip to content

A simple app which broadly explains about the firebase/flutter(CREATE, READ, UPDATE and DELETE).Gone through the setting of firebase database and linking to flutter project.

Notifications You must be signed in to change notification settings

Shahabas008/CRUD-App-Firebase-Flutter

Repository files navigation

CRUD APP

This app is truly for the beginners on firebase and flutter.

Initially create an account in firebase and connect the app to the firebase. You can read the tutorial here https://firebase.google.com/docs/android/setup

Firebase is one of the most popular BaaS used in mobile development. It offers a variety of services for mobile development, one of which we will be discussing in this article — Firebase Firestore. Firestore allows you to upload and retrieve data with very short and simple commands.

I have built this app to demonstrate Firestore CRUD ( Create Read Update Delete) operations.

Screenshot_20221226_105125

We start by creating a Firebase project. If you need help creating a project on Firebase, you can check out this documentation that will guide you through that.

*Add the following packages to pubspec.yaml file:

Screenshot_20221226_104156

Next, we initialize Firebase in our project

*Make your main function an async function and add these lines before the runApp() function:

Screenshot_20221226_104233

*Import the required packages to the project.

Screenshot_20221226_104223


When entering some inputs to the textfields such as NAME, STUDENTID, CGPA ,the input data are stored in the firestore(database).

*My firestore for the project

Screenshot_20221226_102919


CREATE/WRITE

clicking on the create button will store all the inputs from the texfield to the firestore.

Untitled video - Made with Clipchamp


UPDATE

clicking on the update button will update the inputs.

Untitled video - Made with Clipchamp (2)


DELETE

clicking on the delete button will eliminate the desired data from the firestore. Only 'Name'textfield is required to delete an element.

Untitled video - Made with Clipchamp


*At last we using a area where the stored data are display. used streambuilder to display data.StreamBuilder is a widget that builds itself based on the latest snapshot of interaction with a stream. This is mainly used in applications like chat application clock applications where the widget needs to rebuild itself to show the current snapshot of data.

*A DocumentReference refers to a document location in a FirebaseFirestore database and can be used to write, read, or listen to the location. The document at the referenced location may or may not exist. A DocumentReference can also be used to create a CollectionReference to a subcollection.

*On line 279,given a textwidget when the database has no data to display which shows "EMPTY DATABASE".

About

A simple app which broadly explains about the firebase/flutter(CREATE, READ, UPDATE and DELETE).Gone through the setting of firebase database and linking to flutter project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published