Merge pull request #14 from Iconica-Development/3.1.2

feat: add textstyle for fields
This commit is contained in:
Gorter-dev 2023-02-13 15:48:09 +01:00 committed by GitHub
commit d4c639c247
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,6 @@
## 3.1.2
* Added textStyle option for email and password fields
## 3.1.1
* Fix login values not copied to validation

View file

@ -13,6 +13,8 @@ class LoginOptions {
this.passwordLabel,
this.emailInputPrefix,
this.passwordInputPrefix,
this.emailTextStyle,
this.passwordTextStyle,
this.decoration = const InputDecoration(),
this.initialEmail = '',
this.initialPassword = '',
@ -48,6 +50,8 @@ class LoginOptions {
final String initialPassword;
final String? emailHintText;
final String? passwordHintText;
final TextStyle? emailTextStyle;
final TextStyle? passwordTextStyle;
final LoginTranslations translations;
final ValidationService? validationService;

View file

@ -91,7 +91,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
alignment: Alignment.topCenter,
child: _wrapWithDefaultStyle(
options.title,
theme.textTheme.headline6,
theme.textTheme.headlineSmall,
),
)
],
@ -103,7 +103,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
alignment: Alignment.topCenter,
child: _wrapWithDefaultStyle(
options.subtitle,
theme.textTheme.subtitle1,
theme.textTheme.titleSmall,
),
)
],
@ -132,6 +132,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
initialValue: options.initialEmail,
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
style: options.emailTextStyle,
decoration: options.decoration.copyWith(
hintText: options.emailHintText,
prefixIcon: options.emailInputPrefix,
@ -149,6 +150,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
initialValue: options.initialPassword,
keyboardType: TextInputType.visiblePassword,
textInputAction: TextInputAction.done,
style: options.passwordTextStyle,
onFieldSubmitted: (_) => _handleLogin(),
decoration: options.decoration.copyWith(
hintText: options.passwordHintText,

View file

@ -106,6 +106,7 @@ class _ForgotPasswordFormState extends State<ForgotPasswordForm> {
initialValue: options.initialEmail,
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
style: options.emailTextStyle,
decoration: options.decoration.copyWith(
prefixIcon: options.emailInputPrefix,
label: options.emailLabel,

View file

@ -1,6 +1,6 @@
name: flutter_login
description: A new Flutter package project.
version: 3.1.1
description: Flutter Login Component
version: 3.1.2
environment:
sdk: ">=2.18.1 <3.0.0"