🔥

Implementing Firebase in Flutter Applications

May 29, 2025

Firebase Features Implementation in Flutter Application

Introduction

  • Series Overview: Implementing Firebase features in a Flutter application.
  • Objectives:
    • Set up Firebase manually and using CLI.
    • Implement email/password and phone authentication using Firebase.
    • Utilize Firebase Firestore and understand Firebase storage.
    • Understand and implement Firebase Cloud Messaging (FCM).

Setting Up Firebase

Requirements

  • Gmail Account: Required to log into Firebase console.

Steps to Set Up Firebase

  1. Create a Firebase Project:

    • Go to Firebase console.
    • Click on "Get started with Firebase project."
    • Accept terms and conditions.
    • Name the project (e.g., "login sign") and create it.
    • Firebase project creation confirmation.
  2. Create a Flutter Project:

    • Open Android Studio.
    • Create a new Flutter project.
    • Assign a project name (e.g., "sign up loging").
    • Exclude platforms not needed (Linux, macOS, web, Windows).
    • Project creation confirmation.
  3. Connect Firebase with Flutter:

    • Open Firebase console and select Android.
    • Retrieve package name from Android Studio:
      • Navigate to build.gradle in the Android folder.
    • Register app with the package name.
    • Download google-services.json and paste it into the app-level folder in the Flutter project.
  4. Add Firebase Plugins:

    • Open android.build.gradle file.
    • Paste copied plugins from Firebase console.
    • Repeat for app-level build.gradle.
  5. Initialize Firebase in Flutter:

    • Use flutter pub add firebase_core and flutter pub get.
    • In main.dart, initialize Firebase with: WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp();
  6. Run the Application:

    • Connect device via USB.
    • Click run in Android Studio.
    • Confirm successful connection by running the app.

Conclusion

  • Successfully set up and connected a Firebase project with a Flutter application.
  • Next steps: Learn Firebase CLI setup in the following video.
  • Thank you for attending.