Merge pull request #24 from Iconica-Development/bugfix/input-values-clearing

fix: input values clearing on next step
This commit is contained in:
Gorter-dev 2024-04-04 09:51:30 +02:00 committed by GitHub
commit 05b143a5bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 129 additions and 90 deletions

View file

@ -4,6 +4,9 @@ SPDX-FileCopyrightText: 2022 Iconica
SPDX-License-Identifier: GPL-3.0-or-later
-->
# 2.0.2
- fix: fixed the issue with values not being saved when calling nextStep.
# 2.0.1
- feat: added circular progress indicator while awaiting registration of user
- feat: added alignment option for buttons

View file

@ -227,6 +227,25 @@ class _AuthScreenState extends State<AuthScreen> {
],
),
),
],
Expanded(
flex: widget.formFlex ?? 3,
child: Align(
child: Column(
children: [
for (AuthField field
in widget.steps[i].fields) ...[
if (field.title != null) ...[
field.title!,
],
field.build(context, () {
_validate(i);
})
]
],
),
),
),
Column(
children: [
Row(
@ -294,14 +313,12 @@ class _AuthScreenState extends State<AuthScreen> {
child: Row(
children: [
Text(
widget.steps.last ==
widget.steps[i]
widget.steps.last == widget.steps[i]
? widget.submitBtnTitle
: widget.nextBtnTitle,
),
const Padding(
padding:
EdgeInsets.only(left: 4.0),
padding: EdgeInsets.only(left: 4.0),
child: Icon(
Icons.arrow_forward,
size: 18,
@ -320,7 +337,6 @@ class _AuthScreenState extends State<AuthScreen> {
],
),
],
],
),
],
),

View file

@ -13,6 +13,10 @@ class RegistrationOptions {
required this.registrationRepository,
required this.registrationSteps,
required this.afterRegistration,
this.titleFlex,
this.formFlex,
this.beforeTitleFlex,
this.afterTitleFlex,
this.registrationTranslations = const RegistrationTranslations.empty(),
this.onError,
this.customAppbarBuilder,
@ -62,6 +66,18 @@ class RegistrationOptions {
/// A custom widget for displaying a login button.
Widget? loginButton;
/// The number of flex units for the title.
final int? titleFlex;
/// The number of flex units for the form.
final int? formFlex;
/// The number of flex units for the buttons.
final int? beforeTitleFlex;
/// The number of flex units for the buttons.
final int? afterTitleFlex;
/// Generates default registration steps.
///
/// [emailController] controller for email input.

View file

@ -76,6 +76,10 @@ class RegistrationScreenState extends State<RegistrationScreen> {
titleWidget: widget.registrationOptions.titleWidget,
loginButton: widget.registrationOptions.loginButton,
isLoading: _isLoading,
titleFlex: widget.registrationOptions.titleFlex,
formFlex: widget.registrationOptions.formFlex,
beforeTitleFlex: widget.registrationOptions.beforeTitleFlex,
afterTitleFlex: widget.registrationOptions.afterTitleFlex,
);
}
}

View file

@ -4,7 +4,7 @@
name: flutter_registration
description: A Flutter Registration package
version: 2.0.1
version: 2.0.2
repository: https://github.com/Iconica-Development/flutter_registration
publish_to: none