This package provides an Auth widget that seamlessly integrates with Firebase Authentication to manage user login state. It allows developers to specify custom UI for both logged in and not logged in states, making it easy to navigate users to appropriate pages or screens.

Features

  1. Seamless integration with Firebase Authentication.
  2. Customizable UI based on authentication state.
  3. Handles navigation to appropriate screens based on user login status.

Getting started

flutter pub add firebase_auth_handler

Usage

To use this package, include the Auth widget in your app and provide builders for logged in and not logged in states.

import 'package:flutter/material.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_auth_handler/firebase_auth_handler.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Auth(
        loggedInBuilder: (context) => HomePage(), // Widget for logged in state
        notLoggedInBuilder: (context) => LoginPage(), // Widget for not logged in state
      ),
    );
  }
}