[![Buy Me A Coffee](https://img.shields.io/badge/Donate-Buy%20Me%20A%20Coffee-yellow.svg)](https://www.buymeacoffee.com/rodydavis) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WSH3GVC49GNNJ) # 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](https://github.com/FirebaseExtended/flutterfire) packages to do anything this plugin could. ## Getting Started Setup your Bloc ```dart final _auth = AuthBloc(); ``` Follow Installation Instructions for Web: https://pub.dev/packages/firebase Update `/web/index.html` in the body tag. ```html ``` 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: ```gradle classpath 'com.google.gms:google-services:4.2.0' ``` ## Actions - Check Current User ```dart _auth.dispatch(CheckUser()); ``` - Listen for Auth Changes ```dart _userChanged = _fbAuth.onAuthChanged().listen((user) { _auth.dispatch(UpdateUser(user)); }); ``` - Logout ```dart _auth.dispatch(LogoutEvent(_user)); ``` - Login ```dart _auth.dispatch(LoginEvent(_email, _password)); ``` - Guest ```dart _auth.dispatch(LoginGuest()); ``` - Create Account ```dart _auth.dispatch(CreateAccount(_email, _password, displayName: _name)); ``` - Edit Info ```dart _auth.dispatch(EditInfo(displayName: _name)); ``` - Forgot Password ```dart _auth.dispatch(ForgotPassword(_email)); ``` - Send Email Verification ```dart _auth.dispatch(SendEmailVerification()); ```