firebase_ui_oauth_oidc 0.2.0 firebase_ui_oauth_oidc: ^0.2.0 copied to clipboard
Firebase UI widget for authentication through OAuth2/OIDC providers
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:firebase_ui_oauth_oidc/firebase_ui_oauth_oidc.dart';
import 'package:flutter/material.dart';
import 'example_button_style.dart';
import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
FirebaseUIAuth.configureProviders([
OidcProvider(providerId: 'oidc.example', style: const ExampleButtonStyle()),
]);
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: SignInScreen(
actions: [
AuthStateChangeAction<SignedIn>((context, state) {
// redirect to other screen
})
],
),
);
}
}