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