Skip to content

Commit 46c993e

Browse files
committed
style(auth): improve email code verification UI
- Standardize spacing and text styles - Improve button styling and loader - Enhance text input appearance - Stretch buttons to fill width
1 parent af49e0b commit 46c993e

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

lib/authentication/view/email_code_verification_page.dart

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,30 @@ class EmailCodeVerificationPage extends StatelessWidget {
4848
child: SingleChildScrollView(
4949
child: Column(
5050
mainAxisAlignment: MainAxisAlignment.center,
51+
crossAxisAlignment: CrossAxisAlignment.stretch, // Stretch buttons
5152
children: [
52-
const Icon(Icons.mark_email_read_outlined, size: 80),
53+
Icon(
54+
Icons.mark_email_read_outlined,
55+
size: AppSpacing.xxl * 2, // Standardized large icon
56+
color: colorScheme.primary,
57+
),
5358
const SizedBox(height: AppSpacing.xl),
5459
Text(
5560
l10n.emailCodeSentConfirmation(email),
56-
style: textTheme.titleLarge,
61+
style: textTheme.headlineSmall?.copyWith(
62+
fontWeight: FontWeight.bold, // Ensure prominence
63+
),
5764
textAlign: TextAlign.center,
5865
),
59-
const SizedBox(height: AppSpacing.xxl),
66+
const SizedBox(height: AppSpacing.lg), // Adjusted spacing
6067
Text(
6168
l10n.emailCodeSentInstructions,
62-
style: textTheme.bodyMedium,
69+
style: textTheme.bodyLarge?.copyWith(
70+
color: colorScheme
71+
.onSurfaceVariant), // Softer color
6372
textAlign: TextAlign.center,
6473
),
65-
const SizedBox(height: AppSpacing.lg),
74+
const SizedBox(height: AppSpacing.xl), // Increased spacing
6675
_EmailCodeVerificationForm(
6776
email: email,
6877
isLoading: isLoading,
@@ -118,25 +127,29 @@ class _EmailCodeVerificationFormState
118127
@override
119128
Widget build(BuildContext context) {
120129
final l10n = context.l10n;
130+
final textTheme = Theme.of(context).textTheme; // Added missing textTheme
121131

122132
return Form(
123133
key: _formKey,
124134
child: Column(
125135
mainAxisSize: MainAxisSize.min,
126136
children: [
127137
Padding(
128-
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.md),
138+
// No horizontal padding needed if column is stretched
139+
// padding: const EdgeInsets.symmetric(horizontal: AppSpacing.md),
140+
padding: EdgeInsets.zero,
129141
child: TextFormField(
130142
controller: _codeController,
131143
decoration: InputDecoration(
132-
hintText: l10n.emailCodeVerificationHint,
133-
border: const OutlineInputBorder(),
144+
labelText: l10n.emailCodeVerificationHint, // Use labelText
145+
// border: const OutlineInputBorder(), // Uses theme default
134146
counterText: '', // Hide the counter
135147
),
136148
keyboardType: TextInputType.number,
137149
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
138150
maxLength: 6,
139151
textAlign: TextAlign.center,
152+
style: textTheme.headlineSmall, // Make input text larger
140153
enabled: !widget.isLoading,
141154
validator: (value) {
142155
if (value == null || value.isEmpty) {
@@ -150,17 +163,23 @@ class _EmailCodeVerificationFormState
150163
onFieldSubmitted: widget.isLoading ? null : (_) => _submitForm(),
151164
),
152165
),
153-
const SizedBox(height: AppSpacing.xl),
166+
const SizedBox(height: AppSpacing.xxl), // Increased spacing
154167
ElevatedButton(
168+
style: ElevatedButton.styleFrom(
169+
padding: const EdgeInsets.symmetric(vertical: AppSpacing.md),
170+
textStyle: textTheme.labelLarge,
171+
),
155172
onPressed: widget.isLoading ? null : _submitForm,
156-
child:
157-
widget.isLoading
158-
? const SizedBox(
159-
height: 24,
160-
width: 24,
161-
child: CircularProgressIndicator(strokeWidth: 2),
162-
)
163-
: Text(l10n.emailCodeVerificationButtonLabel),
173+
child: widget.isLoading
174+
? const SizedBox(
175+
height: AppSpacing.xl, // Consistent size with text
176+
width: AppSpacing.xl,
177+
child: CircularProgressIndicator(
178+
strokeWidth: 2,
179+
color: Colors.white, // Explicit color for loader on button
180+
),
181+
)
182+
: Text(l10n.emailCodeVerificationButtonLabel),
164183
),
165184
],
166185
),

0 commit comments

Comments
 (0)