सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Stacked Firebase Auth एक सरलीकृत सेवा क्लास है जो कई प्लेटफॉर्मों पर Firebase प्रमाणीकरण को सरल बनाता है। यह लॉगिन, लॉगआउट और उपयोगकर्ता अवस्था प्रबंधन के लिए एक एकीकृत API प्रदान करता है, बॉइलरप्लेट कोड को कम करता है। Stacked आर्किटेक्चर के उपयोग के लिए बनाया गया है, यह Android, iOS, Web और macOS पर Firebase की प्रमाणीकरण सेवाओं के साथ Flutter ऐप में बिना किसी दिक्कत के एकीकृत होता है। इस पैकेज ने जटिल Firebase इंटरैक्शन को सरल, सुसंगत तरीके से बदल दिया है, जिससे डेवलपर उत्पादकता और रखरखाव में सुधार होता है।
उपयोग
उपयोगकर्ता लॉगिन और लॉगआउट कार्यप्रवाह
प्रमाणित उपयोगकर्ता सत्र का प्रबंधन
स्टैक्ड आर्किटेक्चर के साथ Firebase Auth का एकीकरण
क्रॉस-प्लेटफ़ॉर्म प्रमाणीकरण
प्रमाणीकरण अवस्था प्रबंधन को सरल बनाना
मुख्य विशेषताएँ
Firebase Auth के लिए एकल एकीकृत API
Stacked फ्रेमवर्क के लिए निर्मित समर्थन
प्लेटफॉर्म के अनुकूलता
प्राधिकरण तर्क का स्पष्ट विभाजन
Firebase सेवाओं के साथ आसान एकीकरण
इनके लिए उपयुक्त
Stacked आर्किटेक्चर का उपयोग करने वाले Flutter विकासकर्ता
निरंतर Firebase Auth कार्यान्वयन की आवश्यकता वाले ऐप
कई प्लेटफॉर्म के लिए प्रोजेक्ट्स
स्पष्ट, बनाए रखने योग्य प्रमाणीकरण कोड पर ध्यान केंद्रित टीमें
विचार योग्य बातें
स्टैक्ड फ्रेमवर्क सेटअप की आवश्यकता है
Firebase Auth तक सीमित (अतिरिक्त विशेषताएं नहीं)
Firebase संघन के आधार पर
गैर-स्टैक्ड प्रोजेक्ट्स के लिए उपयुक्त नहीं
कस्टम प्रमाणीकरण प्रवाह के लिए अतिरिक्त सेटअप की आवश्यकता हो सकती है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Firebase Authentication Service
This package is meant to work with the Stacked framework and provides a FirebaseAuthenticationService that provides the following logins:
It wraps the functionality for those four auth providers. Examples to come soon. This package has initially been published to improve the BoxtOut tutorial for setting up Firebase Auth.
Dependencies
This package is relying on the following great packages to support the social providers:
Log into Firebase using your Google account by running the following command: firebase login.
Install the FlutterFire CLI with the following dart command : dart pub global activate flutterfire_cli.
Step 2: Configure your apps to use Firebase (on each project)
Use the flutterfire CLI to enable Firebase and create the configuration files in your project: flutterfire configure. You will be asked to select the project you want to configure and the platforms you want to enable.
In your lib/main.dart, you will now be able to add await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); to initialise the default instance of Firebase.
// Add those importsimport'package:example/firebase_options.dart';
import'package:firebase_core/firebase_core.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Add this lineFirebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
awaitsetupLocator();
setupDialogUi();
setupBottomSheetUi();
runApp(constMainApp());
}
Install the package and register the service
If you support iOS, update the ios\Podfile to include platform :ios, '12.0'
If you support Android, update android/app/build.gradle to define minSdkVersion to 21
This package is heavily relying on google_sign_in. Please follow the configuration process described on their doc the the platforms you want to support.
This package is heavily relying on sign_in_with_apple. Please follow the configuration process described on their doc the the platforms you want to support.
Activate the Apple Sign-in provider on Firebase Console + configure the callback URL in the Service IDs.
iOS Activate Sign in with Apple capability through XCode
4 Android Ensure the authentication window will be run via a full external browser (otherwise authentication might fail with storage access error).
To know if Apple Signin is available on the platform and if you need to display the button, you can use
This package is heavily relying on flutter_facebook_auth. Please follow the configuration process described on their doc the the platforms you want to support.
⚠️ Debug and prod build have different SHA signatures.
Future Development
[ ] Add functionality to set the logger or use a default one
[ ] Add the codes thrown from the service into the readme
[ ] Add option to throw exceptions instead of returning a FirebaseAuthenticationResult
[x] Add example to the package
[x] Add a proper readme
[x] Add examples into the readme
[ ] Add mobile authentication option (implementation already exists, it just needs to be moved in here)
[ ] Add other authentication providers
Breaking Changes
2.20.0: Add flutter_facebook_auth dependency and its implementation
0.2.1: Removed flutter_facebook_auth dependency and its implementation since it was causing a MissingPluginException if the app isn't setup for Facebook Auth