Skip to content

Commit ce09cdf

Browse files
committed
fix: correct error screen layout
1 parent a3272f2 commit ce09cdf

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

packages/flutter_user/lib/src/screens/email_password_login_form.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,13 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
262262
passwordTextFormField,
263263
),
264264
),
265-
forgotPasswordButton,
265+
Padding(
266+
padding: const EdgeInsets.only(
267+
top: 4.0,
268+
bottom: 8.0,
269+
),
270+
child: forgotPasswordButton,
271+
),
266272
...buildOptionalSpacer(
267273
options.spacers.spacerAfterForm,
268274
),
@@ -288,6 +294,9 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
288294
),
289295
],
290296
if (widget.onRegister != null) ...[
297+
const SizedBox(
298+
height: 8.0,
299+
),
291300
registerButton,
292301
],
293302
...buildOptionalSpacer(

packages/flutter_user/lib/src/screens/forgot_password_success.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ForgotPasswordSuccess extends StatelessWidget {
4343
child: SafeArea(
4444
bottom: true,
4545
child: Padding(
46-
padding: const EdgeInsets.symmetric(horizontal: 20),
46+
padding: const EdgeInsets.all(20),
4747
child: PrimaryButton(
4848
buttonTitle:
4949
translations.forgotPasswordSuccessButtonTitle,

packages/flutter_user/lib/src/screens/registration_screen.dart

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
124124
controller: _pageController,
125125
physics: const NeverScrollableScrollPhysics(),
126126
children: [
127-
for (var currentStep = 0;
128-
currentStep < registrationOptions.steps.length;
129-
currentStep++) ...[
127+
for (var (index, step)
128+
in registrationOptions.steps.indexed) ...[
130129
Column(
131130
mainAxisSize: MainAxisSize.min,
132131
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -154,8 +153,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
154153
alignment: Alignment.topCenter,
155154
child: Column(
156155
children: [
157-
for (AuthField field in registrationOptions
158-
.steps[currentStep].fields) ...[
156+
for (AuthField field in step.fields) ...[
159157
if (field.title != null) ...[
160158
wrapWithDefaultStyle(
161159
style: theme.textTheme.headlineLarge!,
@@ -167,7 +165,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
167165
maxWidth: registrationOptions.maxFormWidth,
168166
),
169167
child: field.build(context, () {
170-
_validate(currentStep);
168+
_validate(index);
171169
}),
172170
),
173171
],
@@ -194,10 +192,10 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
194192
onPrevious,
195193
registrationOptions
196194
.translations.previousStepBtn,
197-
currentStep,
195+
index,
198196
) ??
199197
Visibility(
200-
visible: currentStep != 0,
198+
visible: index != 0,
201199
child: stepButton(
202200
buttonText: registrationOptions
203201
.translations.previousStepBtn,
@@ -208,19 +206,19 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
208206
),
209207
const SizedBox(width: 16),
210208
registrationOptions.nextButtonBuilder?.call(
211-
onPrevious,
212-
currentStep ==
209+
onClickNext,
210+
index ==
213211
registrationOptions
214212
.steps.length -
215213
1
216214
? registrationOptions
217215
.translations.registerBtn
218216
: registrationOptions
219217
.translations.nextStepBtn,
220-
currentStep,
218+
index,
221219
) ??
222220
stepButton(
223-
buttonText: currentStep ==
221+
buttonText: index ==
224222
registrationOptions
225223
.steps.length -
226224
1
@@ -236,14 +234,10 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
236234
),
237235
),
238236
),
239-
const SizedBox(
240-
height: 8,
241-
),
237+
const SizedBox(height: 8),
242238
if (registrationOptions.loginButton != null) ...[
243239
registrationOptions.loginButton!,
244-
const SizedBox(
245-
height: 8,
246-
),
240+
const SizedBox(height: 8),
247241
],
248242
],
249243
),

packages/flutter_user/lib/src/screens/registration_unsuccessfull.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,13 @@ class RegistrationUnsuccessfull extends StatelessWidget {
5656
),
5757
child: SafeArea(
5858
bottom: true,
59-
child: PrimaryButton(
60-
buttonTitle: registrationOptions
61-
.translations.registrationUnsuccessButtonTitle,
62-
onPressed: onPressed,
59+
child: Padding(
60+
padding: const EdgeInsets.all(20.0),
61+
child: PrimaryButton(
62+
buttonTitle: registrationOptions
63+
.translations.registrationUnsuccessButtonTitle,
64+
onPressed: onPressed,
65+
),
6366
),
6467
),
6568
),

0 commit comments

Comments
 (0)