mirror of
https://github.com/Iconica-Development/flutter_registration.git
synced 2025-05-18 21:23:43 +02:00
Merge pull request #17 from Iconica-Development/fix/small-fixes
feat: small fixes
This commit is contained in:
commit
44871bf44e
8 changed files with 99 additions and 75 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -33,4 +33,5 @@ migrate_working_dir/
|
|||
.packages
|
||||
build/
|
||||
.flutter-plugins
|
||||
.flutter-plugins-dependencies
|
||||
.flutter-plugins-dependencies
|
||||
.metadata
|
|
@ -17,6 +17,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
- feat: added validation to disable next button
|
||||
- feat(auth-screen): add flexible spacing between fields
|
||||
- fix(keyboard-focus): add unfocus for onPrevious
|
||||
- fix: add empty and required constructors for the RegistrationTranslations
|
||||
|
||||
# 1.2.0
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2022 Iconica
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
image: cirrusci/flutter
|
||||
|
||||
pipelines:
|
||||
pull-requests:
|
||||
feature/*:
|
||||
- step:
|
||||
caches:
|
||||
- gradle
|
||||
- gradlewrapper
|
||||
- flutter
|
||||
name: Run analyzer & test
|
||||
script:
|
||||
- flutter pub get
|
||||
- flutter format -o none --set-exit-if-changed .
|
||||
- flutter analyze
|
||||
|
||||
develop:
|
||||
- step:
|
||||
caches:
|
||||
- gradle
|
||||
- gradlewrapper
|
||||
- flutter
|
||||
name: Run analyzer & test
|
||||
script:
|
||||
- flutter pub get
|
||||
- flutter format -o none --set-exit-if-changed .
|
||||
- flutter analyze
|
||||
|
||||
hotfix/*:
|
||||
- step:
|
||||
caches:
|
||||
- gradle
|
||||
- gradlewrapper
|
||||
- flutter
|
||||
name: Run analyzer & test
|
||||
script:
|
||||
- flutter pub get
|
||||
- flutter format -o none --set-exit-if-changed .
|
||||
- flutter analyze
|
||||
|
||||
definitions:
|
||||
caches:
|
||||
gradlewrapper: ~/.gradle/wrapper
|
||||
flutter: ~/.pub-cache
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-FileCopyrightText: 2022 Iconica
|
||||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/// Flutter registration component that provides a registration screen with multiple registration steps.
|
||||
library flutter_registration;
|
||||
|
||||
export 'src/config/registration_options.dart';
|
||||
|
|
|
@ -159,14 +159,12 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
Spacer(
|
||||
flex: widget.beforeTitleFlex ?? 3,
|
||||
child: Container(),
|
||||
),
|
||||
widget.titleWidget!,
|
||||
Expanded(
|
||||
Spacer(
|
||||
flex: widget.afterTitleFlex ?? 2,
|
||||
child: Container(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
@ -12,7 +12,7 @@ class RegistrationOptions {
|
|||
required this.registrationRepository,
|
||||
required this.registrationSteps,
|
||||
required this.afterRegistration,
|
||||
this.registrationTranslations = const RegistrationTranslations(),
|
||||
this.registrationTranslations = const RegistrationTranslations.empty(),
|
||||
this.onError,
|
||||
this.customAppbarBuilder,
|
||||
this.nextButtonBuilder,
|
||||
|
@ -43,7 +43,8 @@ class RegistrationOptions {
|
|||
TextEditingController? pass2Controller,
|
||||
bool pass2Hidden = true,
|
||||
Function(bool mainPass, bool value)? passHideOnChange,
|
||||
RegistrationTranslations translations = const RegistrationTranslations(),
|
||||
RegistrationTranslations translations =
|
||||
const RegistrationTranslations.empty(),
|
||||
Function(String title)? titleBuilder,
|
||||
Function(String label)? labelBuilder,
|
||||
TextStyle? textStyle,
|
||||
|
|
|
@ -2,28 +2,49 @@
|
|||
//
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
/// Holds all the translations for the standard elements on the registration screen.
|
||||
class RegistrationTranslations {
|
||||
const RegistrationTranslations({
|
||||
this.title = 'Register',
|
||||
this.registerBtn = 'Register',
|
||||
this.previousStepBtn = 'Previous',
|
||||
this.nextStepBtn = 'Next',
|
||||
this.closeBtn = 'Close',
|
||||
this.defaultEmailTitle = 'What is your email?',
|
||||
this.defaultEmailLabel = '',
|
||||
this.defaultEmailHint = 'john.doe@domain.com',
|
||||
this.defaultEmailEmpty = 'Enter your email',
|
||||
this.defaultEmailValidatorMessage = 'Enter a valid email address',
|
||||
this.defaultPassword1Title = 'Enter a password',
|
||||
this.defaultPassword1Label = '',
|
||||
this.defaultPassword1Hint = '',
|
||||
this.defaultPassword1ValidatorMessage = 'Enter a valid password',
|
||||
this.defaultPassword2Title = 'Re-enter password',
|
||||
this.defaultPassword2Label = '',
|
||||
this.defaultPassword2Hint = '',
|
||||
this.defaultPassword2ValidatorMessage = 'Passwords have to be equal',
|
||||
required this.title,
|
||||
required this.registerBtn,
|
||||
required this.previousStepBtn,
|
||||
required this.nextStepBtn,
|
||||
required this.closeBtn,
|
||||
required this.defaultEmailTitle,
|
||||
required this.defaultEmailLabel,
|
||||
required this.defaultEmailHint,
|
||||
required this.defaultEmailEmpty,
|
||||
required this.defaultEmailValidatorMessage,
|
||||
required this.defaultPassword1Title,
|
||||
required this.defaultPassword1Label,
|
||||
required this.defaultPassword1Hint,
|
||||
required this.defaultPassword1ValidatorMessage,
|
||||
required this.defaultPassword2Title,
|
||||
required this.defaultPassword2Label,
|
||||
required this.defaultPassword2Hint,
|
||||
required this.defaultPassword2ValidatorMessage,
|
||||
});
|
||||
|
||||
const RegistrationTranslations.empty()
|
||||
: title = 'Register',
|
||||
registerBtn = 'Register',
|
||||
previousStepBtn = 'Previous',
|
||||
nextStepBtn = 'Next',
|
||||
closeBtn = 'Close',
|
||||
defaultEmailTitle = 'What is your email?',
|
||||
defaultEmailLabel = '',
|
||||
defaultEmailHint = 'john.doe@domain.com',
|
||||
defaultEmailEmpty = 'Enter your email',
|
||||
defaultEmailValidatorMessage = 'Enter a valid email address',
|
||||
defaultPassword1Title = 'Enter a password',
|
||||
defaultPassword1Label = '',
|
||||
defaultPassword1Hint = '',
|
||||
defaultPassword1ValidatorMessage = 'Enter a valid password',
|
||||
defaultPassword2Title = 'Re-enter password',
|
||||
defaultPassword2Label = '',
|
||||
defaultPassword2Hint = '',
|
||||
defaultPassword2ValidatorMessage = 'Passwords have to be equal';
|
||||
|
||||
final String title;
|
||||
final String registerBtn;
|
||||
final String previousStepBtn;
|
||||
|
@ -42,4 +63,54 @@ class RegistrationTranslations {
|
|||
final String defaultPassword2Label;
|
||||
final String defaultPassword2Hint;
|
||||
final String defaultPassword2ValidatorMessage;
|
||||
|
||||
// create a copywith
|
||||
RegistrationTranslations copyWith({
|
||||
String? title,
|
||||
String? registerBtn,
|
||||
String? previousStepBtn,
|
||||
String? nextStepBtn,
|
||||
String? closeBtn,
|
||||
String? defaultEmailTitle,
|
||||
String? defaultEmailLabel,
|
||||
String? defaultEmailHint,
|
||||
String? defaultEmailEmpty,
|
||||
String? defaultEmailValidatorMessage,
|
||||
String? defaultPassword1Title,
|
||||
String? defaultPassword1Label,
|
||||
String? defaultPassword1Hint,
|
||||
String? defaultPassword1ValidatorMessage,
|
||||
String? defaultPassword2Title,
|
||||
String? defaultPassword2Label,
|
||||
String? defaultPassword2Hint,
|
||||
String? defaultPassword2ValidatorMessage,
|
||||
}) {
|
||||
return RegistrationTranslations(
|
||||
title: title ?? this.title,
|
||||
registerBtn: registerBtn ?? this.registerBtn,
|
||||
previousStepBtn: previousStepBtn ?? this.previousStepBtn,
|
||||
nextStepBtn: nextStepBtn ?? this.nextStepBtn,
|
||||
closeBtn: closeBtn ?? this.closeBtn,
|
||||
defaultEmailTitle: defaultEmailTitle ?? this.defaultEmailTitle,
|
||||
defaultEmailLabel: defaultEmailLabel ?? this.defaultEmailLabel,
|
||||
defaultEmailHint: defaultEmailHint ?? this.defaultEmailHint,
|
||||
defaultEmailEmpty: defaultEmailEmpty ?? this.defaultEmailEmpty,
|
||||
defaultEmailValidatorMessage:
|
||||
defaultEmailValidatorMessage ?? this.defaultEmailValidatorMessage,
|
||||
defaultPassword1Title:
|
||||
defaultPassword1Title ?? this.defaultPassword1Title,
|
||||
defaultPassword1Label:
|
||||
defaultPassword1Label ?? this.defaultPassword1Label,
|
||||
defaultPassword1Hint: defaultPassword1Hint ?? this.defaultPassword1Hint,
|
||||
defaultPassword1ValidatorMessage: defaultPassword1ValidatorMessage ??
|
||||
this.defaultPassword1ValidatorMessage,
|
||||
defaultPassword2Title:
|
||||
defaultPassword2Title ?? this.defaultPassword2Title,
|
||||
defaultPassword2Label:
|
||||
defaultPassword2Label ?? this.defaultPassword2Label,
|
||||
defaultPassword2Hint: defaultPassword2Hint ?? this.defaultPassword2Hint,
|
||||
defaultPassword2ValidatorMessage: defaultPassword2ValidatorMessage ??
|
||||
this.defaultPassword2ValidatorMessage,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ class AuthBoolField extends AuthField {
|
|||
required this.widgetType,
|
||||
super.title,
|
||||
super.validators = const [],
|
||||
super.value = '',
|
||||
super.value = false,
|
||||
this.leftWidget,
|
||||
this.rightWidget,
|
||||
this.onChange,
|
||||
|
|
Loading…
Reference in a new issue