drdng_firebase_login 1.0.2 copy "drdng_firebase_login: ^1.0.2" to clipboard
drdng_firebase_login: ^1.0.2 copied to clipboard

PlatformAndroidiOS
unlisted

Login screen using FirebaseAuth

Firebase Login #

Platform Support #

Feature Android iOS Web macOS Linux Windows
Email Link
Google
Apple

インストール #

flutter add drdng_firebase_login

pubspec.yamlに以下を追加

dependency_overrides:
  firebase_ui_auth: # メールリンク認証用のボタンデザインをカスタム
    git:
      url: https://github.com/ywake/FirebaseUI-Flutter.git
      path: packages/firebase_ui_auth
      ref: ywake
  firebase_ui_localizations: # 日本語をカスタム
    git:
      url: https://github.com/ywake/FirebaseUI-Flutter.git
      path: packages/firebase_ui_localizations
      ref: ywake
  firebase_ui_oauth: # Google, Apple認証用のボタンデザインをカスタム
    git:
      url: https://github.com/ywake/FirebaseUI-Flutter.git
      path: packages/firebase_ui_oauth
      ref: ywake

localizationsDelegatesに以下を追加

MaterialApp(
  localizationsDelegates: [
    FirebaseUILocalizations.delegate,
  ],
)

使い方の例 #

class LoginPage extends ConsumerWidget {
  const LoginPage({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return FirebaseLogin(
      providers: [
        EmailLinkAuthProvider(
          actionCodeSettings: ref.watch(actionCodeSettingsProvider),
        ),
        GoogleProvider(clientId: '', iOSPreferPlist: true),
        AppleProvider(),
      ],
      onLinkSent: (email) => SharedPrefs.emailLink.set(email),
    );
  }
}