mirror of
https://github.com/Iconica-Development/flutter_input_library.git
synced 2025-05-18 17:03:45 +02:00
Merge pull request #30 from Iconica-Development/feat/password_controller
Feat/password controller
This commit is contained in:
commit
1244353cb7
3 changed files with 13 additions and 2 deletions
|
@ -66,3 +66,6 @@
|
||||||
|
|
||||||
## 3.0.0
|
## 3.0.0
|
||||||
* Updated the FlutterFormInputSwitch to FlutterFormInputBool. This now includes a parameter to either show a checkbox or switch
|
* Updated the FlutterFormInputSwitch to FlutterFormInputBool. This now includes a parameter to either show a checkbox or switch
|
||||||
|
|
||||||
|
## 3.1.0
|
||||||
|
* `FlutterFormInputPassword` now has the controller parameter to set the `TextEditingController` of the `TextFormField`
|
||||||
|
|
|
@ -21,7 +21,9 @@ class FlutterFormInputPassword extends StatefulWidget {
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
this.onFieldSubmitted,
|
this.onFieldSubmitted,
|
||||||
this.enabled = true,
|
this.enabled = true,
|
||||||
|
this.iconSize,
|
||||||
this.decoration,
|
this.decoration,
|
||||||
|
this.controller,
|
||||||
});
|
});
|
||||||
final Widget? label;
|
final Widget? label;
|
||||||
final FocusNode? focusNode;
|
final FocusNode? focusNode;
|
||||||
|
@ -33,7 +35,9 @@ class FlutterFormInputPassword extends StatefulWidget {
|
||||||
final Function(String?)? onChanged;
|
final Function(String?)? onChanged;
|
||||||
final Function(String?)? onFieldSubmitted;
|
final Function(String?)? onFieldSubmitted;
|
||||||
final bool enabled;
|
final bool enabled;
|
||||||
|
final double? iconSize;
|
||||||
final InputDecoration? decoration;
|
final InputDecoration? decoration;
|
||||||
|
final TextEditingController? controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<FlutterFormInputPassword> createState() => _PasswordTextFieldState();
|
State<FlutterFormInputPassword> createState() => _PasswordTextFieldState();
|
||||||
|
@ -50,13 +54,17 @@ class _PasswordTextFieldState extends State<FlutterFormInputPassword> {
|
||||||
obscured = !obscured;
|
obscured = !obscured;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: Icon(obscured ? Icons.visibility_off : Icons.visibility),
|
icon: Icon(
|
||||||
|
obscured ? Icons.visibility_off : Icons.visibility,
|
||||||
|
size: widget.iconSize ?? 24.0,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
var decoration = widget.decoration?.copyWith(suffixIcon: suffixIcon) ??
|
var decoration = widget.decoration?.copyWith(suffixIcon: suffixIcon) ??
|
||||||
InputDecoration(suffixIcon: suffixIcon);
|
InputDecoration(suffixIcon: suffixIcon);
|
||||||
|
|
||||||
return TextFormField(
|
return TextFormField(
|
||||||
|
controller: widget.controller,
|
||||||
style: widget.style,
|
style: widget.style,
|
||||||
initialValue: widget.initialValue,
|
initialValue: widget.initialValue,
|
||||||
inputFormatters: widget.inputFormatters,
|
inputFormatters: widget.inputFormatters,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: flutter_input_library
|
name: flutter_input_library
|
||||||
description: A new Flutter package project.
|
description: A new Flutter package project.
|
||||||
version: 3.0.0
|
version: 3.1.0
|
||||||
repository: https://github.com/Iconica-Development/flutter_input_library
|
repository: https://github.com/Iconica-Development/flutter_input_library
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue