@@ -10,32 +10,13 @@ import 'package:go_router/go_router.dart';
1010import 'package:ui_kit/ui_kit.dart' ;
1111
1212/// {@template authentication_page}
13- /// Displays authentication options (Google, Email, Anonymous) based on context .
13+ /// Displays authentication options (Email, Anonymous) for new users .
1414///
15- /// This page can be used for both initial sign-in and for connecting an
16- /// existing anonymous account.
15+ /// This page is exclusively for initial sign-in/sign-up.
1716/// {@endtemplate}
1817class AuthenticationPage extends StatelessWidget {
1918 /// {@macro authentication_page}
20- const AuthenticationPage ({
21- required this .headline,
22- required this .subHeadline,
23- required this .showAnonymousButton,
24- required this .isLinkingContext,
25- super .key,
26- });
27-
28- /// The main title displayed on the page.
29- final String headline;
30-
31- /// The descriptive text displayed below the headline.
32- final String subHeadline;
33-
34- /// Whether to show the "Continue Anonymously" button.
35- final bool showAnonymousButton;
36-
37- /// Whether this page is being shown in the account linking context.
38- final bool isLinkingContext;
19+ const AuthenticationPage ({super .key});
3920
4021 @override
4122 Widget build (BuildContext context) {
@@ -44,21 +25,7 @@ class AuthenticationPage extends StatelessWidget {
4425 final colorScheme = Theme .of (context).colorScheme;
4526
4627 return Scaffold (
47- appBar: AppBar (
48- backgroundColor: Colors .transparent,
49- elevation: 0 ,
50- // Conditionally add the leading close button only in linking context
51- leading: isLinkingContext
52- ? IconButton (
53- icon: const Icon (Icons .close),
54- tooltip: MaterialLocalizations .of (context).closeButtonTooltip,
55- onPressed: () {
56- // Navigate back to the account page when close is pressed
57- context.goNamed (Routes .accountName);
58- },
59- )
60- : null ,
61- ),
28+ appBar: AppBar (backgroundColor: Colors .transparent, elevation: 0 ),
6229 body: SafeArea (
6330 child: BlocConsumer <AuthenticationBloc , AuthenticationState >(
6431 listener: (context, state) {
@@ -88,23 +55,23 @@ class AuthenticationPage extends StatelessWidget {
8855 Padding (
8956 padding: const EdgeInsets .only (bottom: AppSpacing .xl),
9057 child: Icon (
91- isLinkingContext ? Icons . sync : Icons .newspaper,
58+ Icons .newspaper,
9259 size: AppSpacing .xxl * 2 ,
9360 color: colorScheme.primary,
9461 ),
9562 ),
9663 // const SizedBox(height: AppSpacing.lg),
9764 // --- Headline and Subheadline ---
9865 Text (
99- headline ,
66+ l10n.authenticationSignInHeadline ,
10067 style: textTheme.headlineMedium? .copyWith (
10168 fontWeight: FontWeight .bold,
10269 ),
10370 textAlign: TextAlign .center,
10471 ),
10572 const SizedBox (height: AppSpacing .md),
10673 Text (
107- subHeadline ,
74+ l10n.authenticationSignInSubheadline ,
10875 style: textTheme.bodyLarge? .copyWith (
10976 color: colorScheme.onSurfaceVariant,
11077 ),
@@ -118,11 +85,7 @@ class AuthenticationPage extends StatelessWidget {
11885 onPressed: isLoading
11986 ? null
12087 : () {
121- context.goNamed (
122- isLinkingContext
123- ? Routes .linkingRequestCodeName
124- : Routes .requestCodeName,
125- );
88+ context.goNamed (Routes .requestCodeName);
12689 },
12790 label: Text (l10n.authenticationEmailSignInButton),
12891 style: ElevatedButton .styleFrom (
@@ -134,24 +97,22 @@ class AuthenticationPage extends StatelessWidget {
13497 ),
13598 const SizedBox (height: AppSpacing .lg),
13699
137- // --- Anonymous Sign-In Button (Conditional) ---
138- if (showAnonymousButton) ...[
139- OutlinedButton .icon (
140- icon: const Icon (Icons .person_outline),
141- onPressed: isLoading
142- ? null
143- : () => context.read <AuthenticationBloc >().add (
144- const AuthenticationAnonymousSignInRequested (),
145- ),
146- label: Text (l10n.authenticationAnonymousSignInButton),
147- style: OutlinedButton .styleFrom (
148- padding: const EdgeInsets .symmetric (
149- vertical: AppSpacing .md,
150- ),
151- textStyle: textTheme.labelLarge,
100+ // --- Anonymous Sign-In Button ---
101+ OutlinedButton .icon (
102+ icon: const Icon (Icons .person_outline),
103+ onPressed: isLoading
104+ ? null
105+ : () => context.read <AuthenticationBloc >().add (
106+ const AuthenticationAnonymousSignInRequested (),
107+ ),
108+ label: Text (l10n.authenticationAnonymousSignInButton),
109+ style: OutlinedButton .styleFrom (
110+ padding: const EdgeInsets .symmetric (
111+ vertical: AppSpacing .md,
152112 ),
113+ textStyle: textTheme.labelLarge,
153114 ),
154- ] ,
115+ ) ,
155116
156117 // --- Loading Indicator ---
157118 if (isLoading) ...[
0 commit comments