defaultFields static method
List<Widget>
defaultFields(
- BuildContext context, {
- dynamic onFirstNameChange(
- String value
- dynamic onLastNameChange(
- String value
- dynamic onUsernameChange(
- String value
- dynamic onEmailChange(
- String value
- dynamic onPasswordChange(
- String value
- dynamic onConfirmPasswordChange(
- String value
- List<
InputFeedbackText> ? passwordFeedback, - List<
InputFeedbackText> ? confirmPasswordFeedback, - List<
TextInputFormatter> ? firstNameInputFormatters, - List<
TextInputFormatter> ? lastNameInputFormatters, - List<
TextInputFormatter> ? usernameInputFormatters, - List<
TextInputFormatter> ? emailInputFormatters, - List<
TextInputFormatter> ? passwordInputFormatters, - String? emailLabel,
- String? passwordLabel,
- String? confirmPasswordLabel,
Implementation
static List<Widget> defaultFields(
BuildContext context, {
Function(String value)? onFirstNameChange,
Function(String value)? onLastNameChange,
Function(String value)? onUsernameChange,
Function(String value)? onEmailChange,
Function(String value)? onPasswordChange,
Function(String value)? onConfirmPasswordChange,
List<InputFeedbackText>? passwordFeedback,
List<InputFeedbackText>? confirmPasswordFeedback,
List<TextInputFormatter>? firstNameInputFormatters,
List<TextInputFormatter>? lastNameInputFormatters,
List<TextInputFormatter>? usernameInputFormatters,
List<TextInputFormatter>? emailInputFormatters,
List<TextInputFormatter>? passwordInputFormatters,
String? emailLabel,
String? passwordLabel,
String? confirmPasswordLabel,
}) {
final GBUiKitLocalizations localizations = GBUiKitLocalizations.of(context);
return [
if (onFirstNameChange != null)
TextField(
label: localizations.firstName,
hintText: localizations.enterYourFirstName,
onChanged: onFirstNameChange,
),
if (onLastNameChange != null)
TextField(
label: localizations.lastName,
hintText: localizations.enterYourLastName,
onChanged: onLastNameChange,
inputFormatters: lastNameInputFormatters,
),
if (onUsernameChange != null)
TextField(
label: localizations.username,
hintText: localizations.enterYourUsername,
onChanged: onUsernameChange,
inputFormatters: usernameInputFormatters,
),
if (onEmailChange != null)
TextField(
label: emailLabel ?? localizations.email,
hintText: localizations.enterYourEmail,
keyboardType: TextInputType.emailAddress,
onChanged: onEmailChange,
inputFormatters: emailInputFormatters,
),
if (onPasswordChange != null)
PasswordField(
label: passwordLabel ?? localizations.password,
hintText: localizations.enterYourPassword,
onChanged: onPasswordChange,
inputFormatters: passwordInputFormatters,
feedback: [
if (passwordFeedback != null) ...passwordFeedback
// InputFeedbackText.check(
// key: ValueKey("chars count"),
// active: state.passwordCharCountPass,
// text: Text(
// localizations.xCharacters(6),
// ),
// color: GBTheme.backgroundContrast(context),
// ),
// InputFeedbackText.check(
// key: ValueKey("chars symbols"),
// active: state.passwordSymbolsPass,
// text: Text(
// localizations.mixOfLettersNumbersAndSymbols,
// ),
// color: GBTheme.backgroundContrast(context),
// ),
],
),
if (onConfirmPasswordChange != null)
PasswordField(
label: confirmPasswordLabel ?? localizations.confirmPassword,
hintText: localizations.confirmYourPassword,
onChanged: onConfirmPasswordChange,
inputFormatters: passwordInputFormatters,
feedback: [if (confirmPasswordFeedback != null) ...confirmPasswordFeedback],
),
];
}