Merge pull request #35 from Iconica-Development/feature/suffix-icon-options

feat: Add size and padding options for password suffix icon
This commit is contained in:
Gorter-dev 2024-05-24 09:25:37 +02:00 committed by GitHub
commit 7be44f21d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,7 @@
## 6.1.0
* Added 'suffixIconSize' and 'suffixIconPadding' to LoginOptions.
## 6.0.2
* Added more default loginOptions for login, forgot password and register.

View file

@ -81,6 +81,8 @@ class LoginOptions {
padding: EdgeInsets.symmetric(horizontal: 60),
),
this.forgotPasswordCustomAppBar,
this.suffixIconSize,
this.suffixIconPadding,
});
/// Builds the login button.
@ -152,6 +154,8 @@ class LoginOptions {
/// Determines whether the password field should be obscured.
final bool showObscurePassword;
final double? suffixIconSize;
final EdgeInsets? suffixIconPadding;
/// Get validations.
ValidationService get validations =>

View file

@ -178,6 +178,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
decoration: options.passwordDecoration.copyWith(
suffixIcon: options.showObscurePassword
? IconButton(
padding: options.suffixIconPadding,
onPressed: () {
setState(() {
_obscurePassword =
@ -188,6 +189,7 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
_obscurePassword
? Icons.visibility
: Icons.visibility_off,
size: options.suffixIconSize,
),
)
: null,

View file

@ -1,6 +1,6 @@
name: flutter_login
description: Flutter Login Component
version: 6.0.2
version: 6.1.0
environment:
sdk: ">=2.18.1 <3.0.0"