fb_auth 1.2.0 copy "fb_auth: ^1.2.0" to clipboard
fb_auth: ^1.2.0 copied to clipboard

discontinuedreplaced by: firebase_auth

A Web, Mobile Firebase Auth Plugin

fb_auth #

A Shared Firebase Auth Plugin for Mobile, Web and Desktop. Included AuthBloc for minimal setup! Single dynamic import and compile time ready for ios, android, macos, windows, linux and web.

This package is now deprecated and was originally created to add firebase on the desktop and web. You can now use the FlutterFire packages to do anything this plugin could.

Getting Started #

Setup your Bloc

final _auth = AuthBloc();
copied to clipboard

Follow Installation Instructions for Web: https://pub.dev/packages/firebase

Update /web/index.html in the body tag.

<!-- The core Firebase JS SDK is always required and must be listed first -->
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-app.js"></script>

  <!-- TODO: Add SDKs for Firebase products that you want to use
      https://firebase.google.com/docs/web/setup#config-web-app -->
  <script src="https://www.gstatic.com/firebasejs//6.3.3/firebase-auth.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-firestore.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-storage.js"></script>
  <script src="https://www.gstatic.com/firebasejs/6.3.3/firebase-functions.js"></script>

  <script>
    // Your web app's Firebase configuration
    var firebaseConfig = {
      apiKey: "API_KEY",
      authDomain: "AUTH_DOMAIN",
      databaseURL: "DATABASE_URL",
      projectId: "PROJECT_ID",
      storageBucket: "STORAGE_BUCKET",
      messagingSenderId: "MESSAGING_SENDER_ID",
      appId: "APP_ID"
    };
    // Initialize Firebase
    firebase.initializeApp(firebaseConfig);
  </script>
copied to clipboard

Follow Installation Instructions for Mobile: https://pub.dev/packages/firebase_auth

  • Update ios/Runner and add the GoogleService-Info.plist downloaded from firebase

  • Update android/app and add the google-services.json downloaded from firebase

  • Update android/build.gradle and update the classpath:

    classpath 'com.google.gms:google-services:4.2.0'
copied to clipboard

Actions #

  • Check Current User
_auth.dispatch(CheckUser());
copied to clipboard
  • Listen for Auth Changes
_userChanged = _fbAuth.onAuthChanged().listen((user) {
    _auth.dispatch(UpdateUser(user));
});
copied to clipboard
  • Logout
_auth.dispatch(LogoutEvent(_user));
copied to clipboard
  • Login
_auth.dispatch(LoginEvent(_email, _password));
copied to clipboard
  • Guest
_auth.dispatch(LoginGuest());
copied to clipboard
  • Create Account
_auth.dispatch(CreateAccount(_email, _password, displayName: _name));
copied to clipboard
  • Edit Info
_auth.dispatch(EditInfo(displayName: _name));
copied to clipboard
  • Forgot Password
_auth.dispatch(ForgotPassword(_email));
copied to clipboard
  • Send Email Verification
_auth.dispatch(SendEmailVerification());
copied to clipboard
4
likes
30
points
65
downloads

Publisher

verified publisherrodydavis.com

Weekly Downloads

2024.09.09 - 2025.03.24

A Web, Mobile Firebase Auth Plugin

License

MIT (license)

Dependencies

bloc, firebase, firebase_auth, flutter, flutter_bloc, http, meta, path_provider

More

Packages that depend on fb_auth