How to setup firebase in flutter – Firebase Setup 2022

Flutter, Flutter Firebase, Flutter Login App

In this flutter firebase tutorial, we will learn, how to set up a firebase in a flutter. We will use a simple and quick way to set up a firebase.

Learn to setup firebase in flutter with a quick and easiest way! In this flutter firebase tutorial, we will learn Flutter Firebase Setup [2022] from scratch. We will use latest Flutter Firebase CLI method to setup firebase in flutter. We will use the node.js npm command to install flutter firebase. Also see the warning of Path variables while setting up the firebase and add it in environment variables.

Create a new Firebase Project

To set up a firebase in flutter, we first have to create a new project in Firebase Console.

So, to create a new project. Open Firebase in your browser.

Select Firebase Console from the browser’s top right corner and sign in using your Gmail Account.

Once Logged In, click on the + icon to create a new firebase project and when the project will be created you have to select Firebase Icon on the dashboard.

List of options will be opened to configure your firebase project. All those steps are given below.

Step 1: Install the required command line tools

To install Firebase, first and foremost we have to setup Firebase CLI. Open the firebase documentation to setup firebase in Flutter and choose the desired Platform (Android in our case).

Make sure you have IDE downloaded, Flutter SDK install and Flutter project created.

There are two ways to setup Firebase CLI.

  1. stand alone binary (.exe)
  2. npm (Node.js)

We will use 2nd method using Node.js. To use npm (the Node Package Manager) to install the Firebase CLI, follow these steps:

1.  Install Node.js using nvm-windows (the Node Version Manager). Installing Node.js automatically installs the npm command tools.

2.  Install the Firebase CLI via npm by running the following command:

npm install -g firebase-tools
npm install -g firebase-tools

npm install -g firebase-tools

This command enables the globally available firebase command.

3.  Continue to log in and test the CLI.

     Log into Firebase using your Google account by running the following command:

firebase login

4.  Install the FlutterFire CLI by running the following command from any directory:

dart pub global activate flutterfire_cli

Use the FlutterFire CLI to configure your Flutter apps to connect to Firebase.

From your Flutter project directory, run the following command to start the app configuration workflow:

flutterfire configure

From your Flutter project directory, run the following command to install the core plugin:

flutter pub add firebase_core

From your Flutter project directory, run the following command to ensure that your Flutter app’s Firebase configuration is up-to-date:

flutterfire configure

In your lib/main.dart file, import the Firebase core plugin and the configuration file you generated earlier:

 import 'package:firebase_core/firebase_core.dart'

import 'firebase_options.dart';

Also in your lib/main.dart file, initialize Firebase using the DefaultFirebaseOptions object exported by the configuration file:

await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,

);

Rebuild your Flutter application:

flutter run

Let's Connect

Videos are always a better source for in-depth knowledge. So, connect with me at YouTube.

Download Project

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Latest Courses

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Learn flutter from scratch in 4 hours - Flutter Crash Course - Coding with T

Latest Tutorials

Flutter Profile page UI Design - Flutter app design 2023 - Profile Screen Flutter UI - Flutter 2023
Flutter Firebase phone authentication - Firebase Phone auth tutorial in flutter - Flutter Firebase phone number authentication 2022
Firebase Authentication in flutter - Flutter firebase authentication 2022 - firebase auth tutorial 2022 - firebase flutter auth
How to setup firebase in flutter 2022 - Flutter firebase setup
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!