bloc_firebase_auth_kit 1.0.0 copy "bloc_firebase_auth_kit: ^1.0.0" to clipboard
bloc_firebase_auth_kit: ^1.0.0 copied to clipboard

A clean architecture Flutter package for Firebase authentication with BLoC state management, supporting email/password, Google, Facebook sign-in, and more.

example/lib/main.dart

import 'package:bloc_firebase_auth_kit/bloc_firebase_auth_kit.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

import 'core/di/app_service_locator.dart';
import 'core/routing/app_router.dart';
import 'firebase_options.dart';

/// Example app demonstrating bloc_firebase_auth_kit package usage
void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  try {
    // Initialize Firebase
    await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );

    // Initialize dependency injection
    await AppServiceLocator.init();

    runApp(const ExampleApp());
  } catch (e) {
    print('Error during app initialization: $e');
    runApp(MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Initialization Error: $e'),
        ),
      ),
    ));
  }
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => getIt.get<AuthBloc>()..add(const AuthCheckRequested()),
      child: MaterialApp.router(
        title: 'bloc_firebase_auth_kit Example',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          useMaterial3: true,
          appBarTheme: const AppBarTheme(
            centerTitle: true,
            elevation: 0,
          ),
          cardTheme: const CardThemeData(
            elevation: 2,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.circular(12)),
            ),
          ),
        ),
        routerConfig: AppRouter.router,
      ),
    );
  }
}
2
likes
130
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A clean architecture Flutter package for Firebase authentication with BLoC state management, supporting email/password, Google, Facebook sign-in, and more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

dartz, equatable, firebase_auth, firebase_core, flutter, flutter_bloc, flutter_facebook_auth, flutter_signin_button, get_it, google_sign_in, shared_preferences

More

Packages that depend on bloc_firebase_auth_kit