LoginTemplate constructor

const LoginTemplate({
  1. Key? key,
  2. EdgeInsets padding = const EdgeInsets.only(top: 24, bottom: 16, left: 16, right: 16),
  3. bool forceFullHeight = true,
  4. required bool authenticating,
  5. required void onLogin(
    1. String email,
    2. String password
    ),
  6. bool canSubmit = true,
  7. bool centerHead = false,
  8. bool centerFields = true,
  9. Alignment forgotPasswordAlignment = Alignment.centerLeft,
  10. Widget forgotPasswordBuilder(
    1. BuildContext context,
    2. Widget child
    )?,
  11. bool hideFieldsLabel = false,
  12. @Deprecated("Please use instead: 'spaceBetweenIconAndTitle'") double? spaceBetweenIconAndWelcome,
  13. double spaceBetweenIconAndTitle = 25,
  14. @Deprecated("Please use instead: 'spaceBetweenWelcomeAndSubtitle'") double? spaceBetweenWelcomeAndDescription,
  15. double spaceBetweenWelcomeAndSubtitle = 0,
  16. double spaceBetweenHeadAndFields = 40,
  17. double spaceBetweenFields = 40,
  18. double spaceBetweenFieldsAndButton = 50,
  19. @Deprecated("Please use instead: 'titleText'") String? welcomeText,
  20. String? titleText,
  21. @Deprecated("Please use instead: 'descriptionText'") String? descriptionText,
  22. String? subtitleText,
  23. String? buttonText,
  24. String? signUpLegendText,
  25. String? emailFieldHintText,
  26. String? passwordFieldHintText,
  27. Widget? icon,
  28. @Deprecated("Please use instead 'titleTextColor'") Color? welcomeTextColor,
  29. Color? titleTextColor,
  30. @Deprecated("Please use instead 'descriptionTextColor'") Color? descriptionTextColor,
  31. Color? subtitleTextColor,
  32. Color? legendTextColor,
  33. TextStyle? legendNormalStyle,
  34. TextStyle? legendActionStyle,
  35. Widget? loginOptions,
  36. void onForgotPasswordTap()?,
  37. void onHaveAccountLegendTap()?,
  38. ButtonSize? buttonSize,
  39. List<WidgetStateProperty<Color>>? buttonColors,
  40. Widget mainButtonBuilder(
    1. Widget defaultCta,
    2. dynamic callback(),
    3. bool submitting,
    4. GBUiKitLocalizations localizations,
    5. bool isDisabled,
    )?,
  41. Widget titleBuilder(
    1. GBUiKitLocalizations localizations
    )?,
  42. Widget subtitleBuilder(
    1. GBUiKitLocalizations localizations
    )?,
  43. bool wrapInSafeArea = true,
  44. bool centerTitles = false,
  45. String? emailLabel,
  46. String? passwordLabel,
  47. WrapWidgetBuilder? haveAnAccountBuilder,
  48. String? emailValue,
  49. String? passwordValue,
  50. InputDecoration? emailFieldInputDecoration,
  51. InputDecoration passwordFieldInputDecoration(
    1. BuildContext context,
    2. Widget icon
    )?,
  52. bool haveAnAccountActionUppercase = true,
  53. 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);