mirror of
https://github.com/Iconica-Development/flutter_registration.git
synced 2025-05-19 05:23:43 +02:00
Merge commit '7012942ce50a2de8c8a481595d8bca6e7a02c4de' into feat/buttons_and_fields
This commit is contained in:
commit
078574c214
4 changed files with 69 additions and 46 deletions
|
@ -19,6 +19,8 @@ class AuthScreen extends StatefulWidget {
|
|||
this.customBackgroundColor,
|
||||
this.nextButtonBuilder,
|
||||
this.previousButtonBuilder,
|
||||
this.titleWidget,
|
||||
this.loginButton,
|
||||
super.key,
|
||||
}) : assert(steps.length > 0, 'At least one step is required');
|
||||
|
||||
|
@ -35,6 +37,8 @@ class AuthScreen extends StatefulWidget {
|
|||
final Color? customBackgroundColor;
|
||||
final Widget Function(Future<void> Function(), String)? nextButtonBuilder;
|
||||
final Widget? Function(VoidCallback, String)? previousButtonBuilder;
|
||||
final Widget? titleWidget;
|
||||
final Widget? loginButton;
|
||||
|
||||
@override
|
||||
State<AuthScreen> createState() => _AuthScreenState();
|
||||
|
@ -113,10 +117,12 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||
children: <Widget>[
|
||||
for (AuthStep step in widget.steps)
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// Text(widget.title),
|
||||
if (widget.titleWidget != null) widget.titleWidget!,
|
||||
const SizedBox(height: 40),
|
||||
Flexible(
|
||||
child: Center(
|
||||
child: ListView(
|
||||
physics: const ClampingScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
|
@ -140,11 +146,11 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 15.0,
|
||||
bottom: 30.0,
|
||||
// bottom: 30.0,
|
||||
left: 30.0,
|
||||
right: 30.0,
|
||||
),
|
||||
|
@ -208,7 +214,12 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
if (widget.loginButton != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: widget.loginButton!,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -18,6 +18,8 @@ class RegistrationOptions {
|
|||
this.nextButtonBuilder,
|
||||
this.previousButtonBuilder,
|
||||
this.backgroundColor,
|
||||
this.titleWidget,
|
||||
this.loginButton,
|
||||
});
|
||||
|
||||
final RegistrationTranslations registrationTranslations;
|
||||
|
@ -31,6 +33,8 @@ class RegistrationOptions {
|
|||
final Widget? Function(VoidCallback onPressed, String label)?
|
||||
previousButtonBuilder;
|
||||
final Color? backgroundColor;
|
||||
Widget? titleWidget;
|
||||
Widget? loginButton;
|
||||
|
||||
static List<AuthStep> getDefaultSteps({
|
||||
TextEditingController? emailController,
|
||||
|
|
|
@ -19,6 +19,7 @@ class AuthTextField extends AuthField {
|
|||
this.onChange,
|
||||
this.hidden,
|
||||
this.onPassChanged,
|
||||
this.textFieldDecoration,
|
||||
}) {
|
||||
textController =
|
||||
textEditingController ?? TextEditingController(text: value);
|
||||
|
@ -32,6 +33,7 @@ class AuthTextField extends AuthField {
|
|||
final Function(String value)? onChange;
|
||||
final bool? hidden;
|
||||
final Function(bool value)? onPassChanged;
|
||||
final InputDecoration? textFieldDecoration;
|
||||
|
||||
@override
|
||||
Widget build() {
|
||||
|
@ -55,9 +57,12 @@ class AuthTextField extends AuthField {
|
|||
}
|
||||
}
|
||||
|
||||
return TextFormField(
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: TextFormField(
|
||||
style: textStyle,
|
||||
decoration: InputDecoration(
|
||||
decoration: textFieldDecoration ??
|
||||
InputDecoration(
|
||||
label: label,
|
||||
hintText: hintText,
|
||||
suffix: suffix,
|
||||
|
@ -78,6 +83,7 @@ class AuthTextField extends AuthField {
|
|||
|
||||
return null;
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,8 @@ class RegistrationScreen extends StatelessWidget {
|
|||
nextButtonBuilder: registrationOptions.nextButtonBuilder,
|
||||
previousButtonBuilder: registrationOptions.previousButtonBuilder,
|
||||
customBackgroundColor: registrationOptions.backgroundColor,
|
||||
titleWidget: registrationOptions.titleWidget,
|
||||
loginButton: registrationOptions.loginButton,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue