This package provides an auto_route module for the Firebase UI Auth screens.
To include the Firebase Auth UI screens in your router:
- Import this package
- Add the module to your AutoRouterConfig annotation
- Add the routes you'd like to use to the routes list
// 1. Import the package
import 'package:firebase_auth_auto_route/firebase_auth_auto_route.dart';
@AutoRouterConfig(modules: [FirebaseAuthModule]) // 2. Add the module
class AppRouter extends _$AppRouter {
@override
List<AutoRoute> get routes => [
// 3. Add the routes
AutoRoute(page: SignInRoute.page, initial: true),
AutoRoute(page: ForgotPasswordRoute.page),
];
}
Once the router is set up, you can run the build runner to generate the routes:
flutter pub run build_runner build --delete-conflicting-outputs
You can customize the Firebase UI routes as if you were using the Firebase widgets directly.