LoginTemplate constructor
const
LoginTemplate({
- Key? key,
- EdgeInsets padding = const EdgeInsets.only(top: 24, bottom: 16, left: 16, right: 16),
- bool forceFullHeight = true,
- required bool authenticating,
- required void onLogin(),
- bool canSubmit = true,
- bool centerHead = false,
- bool centerFields = true,
- Alignment forgotPasswordAlignment = Alignment.centerLeft,
- Widget forgotPasswordBuilder(
- BuildContext context,
- Widget child
- bool hideFieldsLabel = false,
- @Deprecated("Please use instead: 'spaceBetweenIconAndTitle'") double? spaceBetweenIconAndWelcome,
- double spaceBetweenIconAndTitle = 25,
- @Deprecated("Please use instead: 'spaceBetweenWelcomeAndSubtitle'") double? spaceBetweenWelcomeAndDescription,
- double spaceBetweenWelcomeAndSubtitle = 0,
- double spaceBetweenHeadAndFields = 40,
- double spaceBetweenFields = 40,
- double spaceBetweenFieldsAndButton = 50,
- @Deprecated("Please use instead: 'titleText'") String? welcomeText,
- String? titleText,
- @Deprecated("Please use instead: 'descriptionText'") String? descriptionText,
- String? subtitleText,
- String? buttonText,
- String? signUpLegendText,
- String? emailFieldHintText,
- String? passwordFieldHintText,
- Widget? icon,
- @Deprecated("Please use instead 'titleTextColor'") Color? welcomeTextColor,
- Color? titleTextColor,
- @Deprecated("Please use instead 'descriptionTextColor'") Color? descriptionTextColor,
- Color? subtitleTextColor,
- Color? legendTextColor,
- TextStyle? legendNormalStyle,
- TextStyle? legendActionStyle,
- Widget? loginOptions,
- void onForgotPasswordTap()?,
- void onHaveAccountLegendTap()?,
- ButtonSize? buttonSize,
- List<
WidgetStateProperty< ? buttonColors,Color> > - Widget mainButtonBuilder(
- Widget defaultCta,
- dynamic callback(),
- bool submitting,
- GBUiKitLocalizations localizations,
- bool isDisabled,
- Widget titleBuilder(
- GBUiKitLocalizations localizations
- Widget subtitleBuilder(
- GBUiKitLocalizations localizations
- bool wrapInSafeArea = true,
- bool centerTitles = false,
- String? emailLabel,
- String? passwordLabel,
- WrapWidgetBuilder? haveAnAccountBuilder,
- String? emailValue,
- String? passwordValue,
- InputDecoration? emailFieldInputDecoration,
- InputDecoration passwordFieldInputDecoration(
- BuildContext context,
- Widget icon
- bool haveAnAccountActionUppercase = true,
- bool submitOnKeyboardAction = false,
Implementation
const LoginTemplate({
Key? key,
this.padding = const EdgeInsets.only(
top: 24,
bottom: 16,
left: 16,
right: 16,
),
this.forceFullHeight = true,
required this.authenticating,
required this.onLogin,
this.canSubmit = true,
this.centerHead = false,
this.centerFields = true,
this.forgotPasswordAlignment = Alignment.centerLeft,
this.forgotPasswordBuilder,
this.hideFieldsLabel = false,
@Deprecated("Please use instead: 'spaceBetweenIconAndTitle'") double? spaceBetweenIconAndWelcome,
double spaceBetweenIconAndTitle = 25,
@Deprecated("Please use instead: 'spaceBetweenWelcomeAndSubtitle'") double? spaceBetweenWelcomeAndDescription,
double spaceBetweenWelcomeAndSubtitle = 0,
this.spaceBetweenHeadAndFields = 40,
this.spaceBetweenFields = 40,
this.spaceBetweenFieldsAndButton = 50,
@Deprecated("Please use instead: 'titleText'") String? welcomeText,
String? titleText,
@Deprecated("Please use instead: 'descriptionText'") String? descriptionText,
String? subtitleText,
this.buttonText,
this.signUpLegendText,
this.emailFieldHintText,
this.passwordFieldHintText,
this.icon,
@Deprecated("Please use instead 'titleTextColor'") Color? welcomeTextColor,
Color? titleTextColor,
@Deprecated("Please use instead 'descriptionTextColor'") Color? descriptionTextColor,
Color? subtitleTextColor,
this.legendTextColor,
this.legendNormalStyle,
this.legendActionStyle,
this.loginOptions,
this.onForgotPasswordTap,
this.onHaveAccountLegendTap,
this.buttonSize,
this.buttonColors,
this.mainButtonBuilder,
this.titleBuilder,
this.subtitleBuilder,
this.wrapInSafeArea = true,
this.centerTitles = false,
this.emailLabel,
this.passwordLabel,
this.haveAnAccountBuilder,
this.emailValue,
this.passwordValue,
this.emailFieldInputDecoration,
this.passwordFieldInputDecoration,
this.haveAnAccountActionUppercase = true,
this.submitOnKeyboardAction = false,
}) : titleText = titleText ?? welcomeText,
subtitleText = subtitleText ?? descriptionText,
titleTextColor = titleTextColor ?? welcomeTextColor,
subtitleTextColor = subtitleTextColor ?? descriptionTextColor,
spaceBetweenIconAndTitle = spaceBetweenIconAndWelcome ?? spaceBetweenIconAndTitle,
spaceBetweenWelcomeAndSubtitle = spaceBetweenWelcomeAndDescription ?? spaceBetweenWelcomeAndSubtitle,
assert(
buttonSize == null || mainButtonBuilder == null,
"You can just define either 'buttonSize' or 'mainButtonBuilder' but not both",
),
assert(
(titleTextColor == null && titleText == null) || titleBuilder == null,
"You can just define either 'welcomeText|titleText' or 'titleBuilder' but not both",
),
assert(
(subtitleTextColor == null && subtitleText == null) || subtitleBuilder == null,
"You can just define either 'descriptionText|subtitleText' or 'subtitleBuilder' but not both",
),
super(key: key);