Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views7 pages

Lab Task 13

This document outlines the steps to connect a Flutter mobile application to a Firebase database, starting with creating a default counter app named 'check_firebase'. It details the process of setting up a Firebase project, registering the app, and adding necessary plugins and dependencies. The document emphasizes using an Android device for running the application and provides a warning against using the web version.

Uploaded by

bereket abera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Lab Task 13

This document outlines the steps to connect a Flutter mobile application to a Firebase database, starting with creating a default counter app named 'check_firebase'. It details the process of setting up a Firebase project, registering the app, and adding necessary plugins and dependencies. The document emphasizes using an Android device for running the application and provides a warning against using the web version.

Uploaded by

bereket abera
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Task 13:

Topic: working with Firebase database


Objective: This lab task is to exercise on firebase.

 To use firebase database for our mobile application we must follow the following steps.
 Before we are going to work with large data first, we must connect flutter with firebase with out
any issue. To data that please create a default mobile app (counter app) with the name of
check_firebase.

 Than try to access firebase console (https://console.firebase.google.com/)

COMPILED BY TADESSE SHEFERA 102


 Next click on Create a Firebase Project
 Next Enter your project name. (for us use checkfirebase)

 After you enter the project name click continue.


 Finally create project (this may take minutes)

COMPILED BY TADESSE SHEFERA 103


 Than click continue

 Than select the app that you went to develop (for now connect with android)

 Click the android icon and than you get the following.

COMPILED BY TADESSE SHEFERA 104


 For Android package name add application id from android/app/build.gradle file

 Then Register app


 For the second step download the google-service and add into your module (app-level)

COMPILED BY TADESSE SHEFERA 105


 You must add like this

 Then click Next


 Then add plugin in build.gradel into app-level and project level

COMPILED BY TADESSE SHEFERA 106


 Fist for project level copy id 'com.google.gms.google-services' version '4.4.2' apply false into root level
build.gredle. but for newest flutter version add this plugin in settings.gradle

 It is recommended to use the latest version of Kotlin. Currently the latest version of kotlin is 2.1.20.
(https://kotlinlang.org/docs/releases.html). Than update the 3rd plugin from the above based on this
 Then save and leave this file
 After that add google-services plugin in app-level

 Now we need to add firebase_core plugin and for this add firebase_core dependency from pub.dev
 use the following shortcut
Ctrl+Shift than write add dependency

Next write firebase_core

COMPILED BY TADESSE SHEFERA 107


Then automatically the dependency is added from pub.dev

 next on main.dart file make the void main () method asynchronous.

 the next step is initializing firebase and to do this add the following two lines of code in main() method

 finally run your application

warnning: make sure you are using our android phone to run this!

If you went to run by web (not recommended) you can read the shared pdf file firebase_for_web.pdf

Happy codding !!

COMPILED BY TADESSE SHEFERA 108

You might also like