Skip to content

Commit 44fa1e8

Browse files
committed
refactor(auth): add iconData to auth pages
1 parent 73c16cc commit 44fa1e8

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

lib/authentication/view/authentication_page.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class AuthenticationPage extends StatelessWidget {
2222
required this.subHeadline,
2323
required this.showAnonymousButton,
2424
required this.isLinkingContext, // Add this parameter
25+
// this.iconData, // REMOVE optional icon data
2526
super.key,
2627
});
2728

@@ -37,6 +38,9 @@ class AuthenticationPage extends StatelessWidget {
3738
/// Whether this page is being shown in the account linking context.
3839
final bool isLinkingContext; // Add this field
3940

41+
/// Optional icon to display at the top of the page.
42+
// final IconData? iconData; // REMOVE this field
43+
4044
@override
4145
Widget build(BuildContext context) {
4246
// Provide the BLoC here if it's not already provided higher up
@@ -54,6 +58,7 @@ class AuthenticationPage extends StatelessWidget {
5458
subHeadline: subHeadline,
5559
showAnonymousButton: showAnonymousButton,
5660
isLinkingContext: isLinkingContext, // Pass down the flag
61+
// iconData: iconData, // REMOVE passing down icon data
5762
),
5863
);
5964
}
@@ -66,12 +71,14 @@ class _AuthenticationView extends StatelessWidget {
6671
required this.subHeadline,
6772
required this.showAnonymousButton,
6873
required this.isLinkingContext, // Add this parameter
74+
// this.iconData, // REMOVE optional icon data
6975
});
7076

7177
final String headline;
7278
final String subHeadline;
7379
final bool showAnonymousButton;
7480
final bool isLinkingContext; // Add this field
81+
// final IconData? iconData; // REMOVE this field
7582

7683
@override
7784
Widget build(BuildContext context) {
@@ -131,6 +138,23 @@ class _AuthenticationView extends StatelessWidget {
131138
MainAxisAlignment.center, // Center vertically
132139
crossAxisAlignment: CrossAxisAlignment.stretch,
133140
children: [
141+
// --- Hardcoded Icon ---
142+
// REMOVE if check: if (iconData != null) ...[
143+
Padding(
144+
padding: const EdgeInsets.only(
145+
bottom: AppSpacing.xl,
146+
), // Spacing below icon
147+
child: Icon(
148+
Icons.security, // Hardcode the icon
149+
size: (Theme.of(context).iconTheme.size ?? AppSpacing.xl) *
150+
3.0, // Use ?? with AppSpacing constant
151+
color: Theme.of(context)
152+
.colorScheme
153+
.primary, // Use theme color
154+
),
155+
),
156+
const SizedBox(height: AppSpacing.lg), // Space between icon and headline
157+
// REMOVE closing bracket for if: ],
134158
// --- Headline and Subheadline ---
135159
Text(
136160
headline,

lib/authentication/view/email_sign_in_page.dart

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ class _EmailSignInView extends StatelessWidget {
4646
// Add a custom leading back button to control navigation based on context.
4747
leading: IconButton(
4848
icon: const Icon(Icons.arrow_back),
49-
tooltip: MaterialLocalizations.of(context).backButtonTooltip, // Accessibility
49+
tooltip:
50+
MaterialLocalizations.of(
51+
context,
52+
).backButtonTooltip, // Accessibility
5053
onPressed: () {
5154
// Navigate back differently based on the context.
5255
if (isLinkingContext) {
@@ -97,6 +100,25 @@ class _EmailSignInView extends StatelessWidget {
97100
mainAxisAlignment: MainAxisAlignment.center,
98101
crossAxisAlignment: CrossAxisAlignment.stretch,
99102
children: [
103+
// --- Hardcoded Icon ---
104+
Padding(
105+
padding: const EdgeInsets.only(
106+
bottom: AppSpacing.xl,
107+
), // Spacing below icon
108+
child: Icon(
109+
Icons.email_outlined, // Hardcoded icon
110+
size: (Theme.of(context).iconTheme.size ?? AppSpacing.xl) *
111+
3.0, // Use ?? with AppSpacing constant
112+
color:
113+
Theme.of(
114+
context,
115+
).colorScheme.primary, // Use theme color
116+
),
117+
),
118+
const SizedBox(
119+
height: AppSpacing.lg,
120+
), // Space between icon and text
121+
// --- Explanation Text ---
100122
Text(
101123
l10n.emailSignInExplanation, // New l10n key needed
102124
style: Theme.of(context).textTheme.bodyLarge,

lib/router/router.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ GoRouter createRouter({required ValueNotifier<AppStatus> authStatusNotifier}) {
182182
subHeadline: subHeadline,
183183
showAnonymousButton: showAnonymousButton,
184184
isLinkingContext: isLinkingContext, // Pass the flag
185+
// iconData: Icons.security, // REMOVE: Parameter no longer exists
185186
);
186187
},
187188
routes: [

0 commit comments

Comments
 (0)