/flutterfirely

Firebase : Auth and Storage

Primary LanguageDart

FlutterFirely

Firebase Auth and Storage

Getting Started

Dependencies

This project uses the following dependencies:

dependencies:
  cupertino_icons: ^1.0.6
  get: latest_version
  icons_plus: ^5.0.0
  firebase_core: ^3.0.0

Note: The following dependencies are currently listed but not used:

  • http
  • shared_preferences
  • connectivity_plus
  • flutter_launcher_icons

Fonts

This project uses the Lufga font.

fonts:
  - family: Lufga
    fonts:
      - asset: assets/fonts/Lufga-Regular.ttf # Ensure the font file exists

Project Structure

The project follows an organized architecture with separate folders for CRUD operations, login functionality, services, and reusable widgets.

Main File

  • lib/main.dart - The entry point of the Flutter application.

CRUD Module

  • lib/crud/
    • crud_controller.dart - Handles CRUD operations.
    • crud_view.dart - UI implementation for CRUD features.

Login Module

  • lib/login/
    • login_controller.dart - Manages authentication logic.
    • login_view.dart - UI for user login.

Services

  • lib/service/
    • firebase_service.dart - Handles Firebase-related functionality.

Widgets

  • lib/widgets/ - Contains reusable UI components.

Steps to Setup Firebase

Step 1 : Go To Firebase Console

Screenshot 2025-03-02 at 5 40 09 PM

Step 2 : Create Project

Screenshot 2025-03-02 at 5 41 25 PM

Step3 : Go To Dashboard and Create Flutter App

Screenshot 2025-03-02 at 5 45 06 PM

Step 3.5 : Install CLI Firebase Firebase CLI

Step 4 : Run Firebase Login in Android Studio Terminal

Screenshot 2025-03-02 at 5 46 34 PM

Step 5 : After Login Run This Command (dart pub global activate flutterfire_cli)

Screenshot 2025-03-02 at 5 54 37 PM

Step 6 : Run This Command which you will get in Project Setup

Screenshot 2025-03-02 at 5 59 10 PM Screenshot 2025-03-02 at 5 59 28 PM Screenshot 2025-03-02 at 6 01 54 PM

Step 7: You will get firebase_options.dart auto generated file

Screenshot 2025-03-02 at 6 07 53 PM

Step 8: Last Step

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  runApp(const MyApp());
}

Steps to Setup Google Login

Step 1: Add in Pubspec Yaml

google_sign_in: ^6.2.2

Step 2: Add a OAuth (Go to console.cloud.google.com) Select proper project

Screenshot 2025-03-02 at 6 30 58 PM

Step 3: Select OAuth Consent

Screenshot 2025-03-02 at 6 34 14 PM

Running the Project

To run the project, ensure you have Flutter installed and execute the following command:

flutter run

Additional Notes

  • Make sure to configure Firebase properly before running the app.
  • If using custom fonts, ensure the font files are added to the assets/fonts/ directory and defined in pubspec.yaml.

Happy Coding! 🚀