mirror of
https://github.com/Iconica-Development/flutter_login_widget.git
synced 2025-05-19 05:33:45 +02:00
Merge pull request #22 from Iconica-Development/feature/showPasswordOption
feat: added the options to disable the show password button
This commit is contained in:
commit
15886ed5c3
5 changed files with 22 additions and 14 deletions
|
@ -1,3 +1,6 @@
|
|||
## 5.1.0
|
||||
* Added the option to disable the showPassword button on the passwordfield.
|
||||
|
||||
## 5.0.0
|
||||
* Removed the redundant initialEmail parameter from 'ForgotPasswordForm'. The only one to use now is the one in the 'LoginOptions'.
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ packages:
|
|||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "4.2.0"
|
||||
version: "5.0.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
|
|
|
@ -28,6 +28,7 @@ class LoginOptions {
|
|||
this.registrationButtonBuilder = _createRegisterButton,
|
||||
this.emailInputContainerBuilder = _createEmailInputContainer,
|
||||
this.passwordInputContainerBuilder = _createPasswordInputContainer,
|
||||
this.showObscurePassword = true,
|
||||
});
|
||||
|
||||
final ButtonBuilder loginButtonBuilder;
|
||||
|
@ -55,6 +56,7 @@ class LoginOptions {
|
|||
final TextStyle? passwordTextStyle;
|
||||
final LoginTranslations translations;
|
||||
final ValidationService? validationService;
|
||||
final bool showObscurePassword;
|
||||
|
||||
ValidationService get validations =>
|
||||
validationService ?? LoginValidationService(this);
|
||||
|
|
|
@ -161,18 +161,21 @@ class _EmailPasswordLoginFormState extends State<EmailPasswordLoginForm> {
|
|||
style: options.passwordTextStyle,
|
||||
onFieldSubmitted: (_) => _handleLogin(),
|
||||
decoration: options.passwordDecoration.copyWith(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscurePassword = !_obscurePassword;
|
||||
});
|
||||
},
|
||||
icon: Icon(
|
||||
_obscurePassword
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
),
|
||||
suffixIcon: options.showObscurePassword
|
||||
? IconButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_obscurePassword =
|
||||
!_obscurePassword;
|
||||
});
|
||||
},
|
||||
icon: Icon(
|
||||
_obscurePassword
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: flutter_login
|
||||
description: Flutter Login Component
|
||||
version: 5.0.0
|
||||
version: 5.1.0
|
||||
|
||||
environment:
|
||||
sdk: ">=2.18.1 <3.0.0"
|
||||
|
|
Loading…
Reference in a new issue