import 'package:go_router/go_router.dart'; import 'package:shuffle/core/routing/app_routes.dart'; import 'package:shuffle/features/auth/presentation/auth_route_placeholder.dart'; import 'package:shuffle/features/auth/presentation/check_email/check_email_screen.dart'; import 'package:shuffle/features/auth/presentation/email_link/email_link_screen.dart'; import 'package:shuffle/features/auth/presentation/register/register_screen.dart'; /// Routes of the auth pages (Spec #1 ยง 5.3). Login, forgot and reset password /// are placeholders until 01b and 01c. final List authRoutes = [ authPlaceholderRoute(AppRoutes.login, 'login'), GoRoute( path: AppRoutes.register, builder: (context, state) => const RegisterScreen(), routes: [ GoRoute( path: 'check-email', builder: (context, state) { // The address travels as `extra`, never in the URL. After a web // reload it is gone; the screen then asks for it. final extra = state.extra; return CheckEmailScreen(email: extra is String ? extra : null); }, ), ], ), authPlaceholderRoute(AppRoutes.forgotPassword, 'forgot_password'), GoRoute( path: AppRoutes.authConfirm, builder: (context, state) => EmailLinkScreen( tokenHash: state.uri.queryParameters['token_hash'], type: state.uri.queryParameters['type'], ), ), authPlaceholderRoute(AppRoutes.resetPassword, 'reset_password'), ];