@@ -7,7 +7,7 @@ import 'package:ht_authentication_repository/ht_authentication_repository.dart';
77import 'package:ht_main/authentication/bloc/authentication_bloc.dart' ;
88import 'package:ht_main/l10n/l10n.dart' ;
99import 'package:ht_main/router/routes.dart' ;
10- import 'package:ht_main/shared/constants/app_spacing.dart' ; // Use shared constants
10+ import 'package:ht_main/shared/constants/app_spacing.dart' ;
1111
1212/// {@template authentication_page}
1313/// Displays authentication options (Google, Email, Anonymous) based on context.
@@ -21,8 +21,7 @@ class AuthenticationPage extends StatelessWidget {
2121 required this .headline,
2222 required this .subHeadline,
2323 required this .showAnonymousButton,
24- required this .isLinkingContext, // Add this parameter
25- // this.iconData, // REMOVE optional icon data
24+ required this .isLinkingContext,
2625 super .key,
2726 });
2827
@@ -36,10 +35,7 @@ class AuthenticationPage extends StatelessWidget {
3635 final bool showAnonymousButton;
3736
3837 /// Whether this page is being shown in the account linking context.
39- final bool isLinkingContext; // Add this field
40-
41- /// Optional icon to display at the top of the page.
42- // final IconData? iconData; // REMOVE this field
38+ final bool isLinkingContext;
4339
4440 @override
4541 Widget build (BuildContext context) {
@@ -57,28 +53,24 @@ class AuthenticationPage extends StatelessWidget {
5753 headline: headline,
5854 subHeadline: subHeadline,
5955 showAnonymousButton: showAnonymousButton,
60- isLinkingContext: isLinkingContext, // Pass down the flag
61- // iconData: iconData, // REMOVE passing down icon data
56+ isLinkingContext: isLinkingContext,
6257 ),
6358 );
6459 }
6560}
6661
67- // Renamed from _AuthenticationView to follow convention
6862class _AuthenticationView extends StatelessWidget {
6963 const _AuthenticationView ({
7064 required this .headline,
7165 required this .subHeadline,
7266 required this .showAnonymousButton,
73- required this .isLinkingContext, // Add this parameter
74- // this.iconData, // REMOVE optional icon data
67+ required this .isLinkingContext,
7568 });
7669
7770 final String headline;
7871 final String subHeadline;
7972 final bool showAnonymousButton;
80- final bool isLinkingContext; // Add this field
81- // final IconData? iconData; // REMOVE this field
73+ final bool isLinkingContext;
8274
8375 @override
8476 Widget build (BuildContext context) {
@@ -130,7 +122,7 @@ class _AuthenticationView extends StatelessWidget {
130122 return Padding (
131123 padding: const EdgeInsets .all (
132124 AppSpacing .paddingLarge,
133- ), // Use constant
125+ ),
134126 child: Center (
135127 child: SingleChildScrollView (
136128 child: Column (
@@ -139,35 +131,33 @@ class _AuthenticationView extends StatelessWidget {
139131 crossAxisAlignment: CrossAxisAlignment .stretch,
140132 children: [
141133 // --- Hardcoded Icon ---
142- // REMOVE if check: if (iconData != null) ...[
143134 Padding (
144135 padding: const EdgeInsets .only (
145136 bottom: AppSpacing .xl,
146137 ), // Spacing below icon
147138 child: Icon (
148139 Icons .security, // Hardcode the icon
149140 size: (Theme .of (context).iconTheme.size ?? AppSpacing .xl) *
150- 3.0 , // Use ?? with AppSpacing constant
141+ 3.0 ,
151142 color: Theme .of (context)
152143 .colorScheme
153- .primary, // Use theme color
144+ .primary,
154145 ),
155146 ),
156147 const SizedBox (height: AppSpacing .lg), // Space between icon and headline
157- // REMOVE closing bracket for if: ],
158148 // --- Headline and Subheadline ---
159149 Text (
160150 headline,
161151 style: textTheme.headlineMedium,
162152 textAlign: TextAlign .center,
163153 ),
164- const SizedBox (height: AppSpacing .sm), // Use constant
154+ const SizedBox (height: AppSpacing .sm),
165155 Text (
166156 subHeadline,
167157 style: textTheme.bodyLarge,
168158 textAlign: TextAlign .center,
169159 ),
170- const SizedBox (height: AppSpacing .xxl), // Use constant
160+ const SizedBox (height: AppSpacing .xxl),
171161 // --- Google Sign-In Button ---
172162 ElevatedButton .icon (
173163 icon: const Icon (
@@ -182,14 +172,14 @@ class _AuthenticationView extends StatelessWidget {
182172 ),
183173 // Style adjustments can be made via ElevatedButtonThemeData
184174 ),
185- const SizedBox (height: AppSpacing .lg), // Use constant
175+ const SizedBox (height: AppSpacing .lg),
186176 // --- Email Sign-In Button ---
187177 ElevatedButton (
188178 // Consider an email icon
189179 // icon: const Icon(Icons.email_outlined),
190180 child: Text (
191181 l10n.authenticationEmailSignInButton,
192- ), // New l10n key needed
182+ ),
193183 onPressed:
194184 isLoading
195185 ? null
@@ -198,14 +188,14 @@ class _AuthenticationView extends StatelessWidget {
198188 // passing the linking context via 'extra'.
199189 context.goNamed (
200190 Routes .emailSignInName,
201- extra: isLinkingContext, // Pass the flag
191+ extra: isLinkingContext,
202192 );
203193 },
204194 ),
205195
206196 // --- Anonymous Sign-In Button (Conditional) ---
207197 if (showAnonymousButton) ...[
208- const SizedBox (height: AppSpacing .lg), // Use constant
198+ const SizedBox (height: AppSpacing .lg),
209199 OutlinedButton (
210200 child: Text (l10n.authenticationAnonymousSignInButton),
211201 onPressed:
0 commit comments