Skip to content

Commit af49e0b

Browse files
committed
feat(auth): improve authentication UI
- Standardize spacing and styling - Add icons to buttons - Improve headline styling - Refactor loading indicator placement
1 parent 4c20f19 commit af49e0b

File tree

1 file changed

+50
-46
lines changed

1 file changed

+50
-46
lines changed

lib/authentication/view/authentication_page.dart

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -97,76 +97,80 @@ class AuthenticationPage extends StatelessWidget {
9797
MainAxisAlignment.center, // Center vertically
9898
crossAxisAlignment: CrossAxisAlignment.stretch,
9999
children: [
100-
// --- Hardcoded Icon ---
100+
// --- Icon ---
101101
Padding(
102-
padding: const EdgeInsets.only(
103-
bottom: AppSpacing.xl,
104-
), // Spacing below icon
102+
padding: const EdgeInsets.only(bottom: AppSpacing.xl),
105103
child: Icon(
106-
Icons.security, // Hardcode the icon
107-
size:
108-
(Theme.of(context).iconTheme.size ??
109-
AppSpacing.xl) *
110-
3.0,
111-
color: Theme.of(context).colorScheme.primary,
104+
Icons.security,
105+
size: AppSpacing.xxl * 2, // Standardized large icon
106+
color: colorScheme.primary,
112107
),
113108
),
114-
const SizedBox(
115-
height: AppSpacing.lg,
116-
), // Space between icon and headline
109+
// const SizedBox(height: AppSpacing.lg), // Removed, padding above handles it
117110
// --- Headline and Subheadline ---
118111
Text(
119112
headline,
120-
style: textTheme.headlineMedium,
113+
style: textTheme.headlineMedium?.copyWith(
114+
fontWeight: FontWeight.bold, // Ensure prominence
115+
),
121116
textAlign: TextAlign.center,
122117
),
123-
const SizedBox(height: AppSpacing.sm),
118+
const SizedBox(height: AppSpacing.md), // Increased spacing
124119
Text(
125120
subHeadline,
126-
style: textTheme.bodyLarge,
121+
style: textTheme.bodyLarge?.copyWith(
122+
color: colorScheme.onSurfaceVariant, // Softer color
123+
),
127124
textAlign: TextAlign.center,
128125
),
129126
const SizedBox(height: AppSpacing.xxl),
127+
130128
// --- Email Sign-In Button ---
131-
ElevatedButton(
132-
// Consider an email icon
133-
// icon: const Icon(Icons.email_outlined),
134-
onPressed:
135-
isLoading
136-
? null
137-
: () {
138-
// Navigate to the dedicated email sign-in page,
139-
// passing the linking context via 'extra'.
140-
context.goNamed(
141-
Routes.requestCodeName,
142-
extra: isLinkingContext,
143-
);
144-
},
145-
// Consider an email icon
146-
// icon: const Icon(Icons.email_outlined),
147-
child: Text(l10n.authenticationEmailSignInButton),
129+
ElevatedButton.icon(
130+
icon: const Icon(Icons.email_outlined),
131+
onPressed: isLoading
132+
? null
133+
: () {
134+
context.goNamed(
135+
Routes.requestCodeName,
136+
extra: isLinkingContext,
137+
);
138+
},
139+
label: Text(l10n.authenticationEmailSignInButton),
140+
style: ElevatedButton.styleFrom(
141+
padding: const EdgeInsets.symmetric(
142+
vertical: AppSpacing.md,
143+
),
144+
textStyle: textTheme.labelLarge,
145+
),
148146
),
147+
const SizedBox(height: AppSpacing.lg),
149148

150149
// --- Anonymous Sign-In Button (Conditional) ---
151150
if (showAnonymousButton) ...[
152-
const SizedBox(height: AppSpacing.lg),
153-
OutlinedButton(
154-
onPressed:
155-
isLoading
156-
? null
157-
: () => context.read<AuthenticationBloc>().add(
151+
OutlinedButton.icon(
152+
icon: const Icon(Icons.person_outline),
153+
onPressed: isLoading
154+
? null
155+
: () => context.read<AuthenticationBloc>().add(
158156
const AuthenticationAnonymousSignInRequested(),
159157
),
160-
child: Text(l10n.authenticationAnonymousSignInButton),
158+
label: Text(l10n.authenticationAnonymousSignInButton),
159+
style: OutlinedButton.styleFrom(
160+
padding: const EdgeInsets.symmetric(
161+
vertical: AppSpacing.md,
162+
),
163+
textStyle: textTheme.labelLarge,
164+
),
161165
),
162166
],
163167

164-
// --- Loading Indicator (Optional, for general loading state) ---
165-
// If needed, show a general loading indicator when state is AuthenticationLoading
166-
if (isLoading &&
167-
state is! AuthenticationRequestCodeLoading) ...[
168-
const SizedBox(height: AppSpacing.xl),
169-
const Center(child: CircularProgressIndicator()),
168+
// --- Loading Indicator ---
169+
if (isLoading && state is! AuthenticationRequestCodeLoading) ...[
170+
const Padding(
171+
padding: EdgeInsets.only(top: AppSpacing.xl),
172+
child: Center(child: CircularProgressIndicator()),
173+
),
170174
],
171175
],
172176
),

0 commit comments

Comments
 (0)