mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Adds ability to show / hide password in profile widget
This commit is contained in:
parent
6d764e32a0
commit
23a27fde67
1 changed files with 11 additions and 1 deletions
|
|
@ -240,6 +240,8 @@ class _ProfileEditState extends State<ProfileEditWidget> {
|
||||||
String username = "";
|
String username = "";
|
||||||
String password = "";
|
String password = "";
|
||||||
|
|
||||||
|
bool _obscured = true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -379,10 +381,18 @@ class _ProfileEditState extends State<ProfileEditWidget> {
|
||||||
labelText: L10().password,
|
labelText: L10().password,
|
||||||
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
labelStyle: TextStyle(fontWeight: FontWeight.bold),
|
||||||
hintText: L10().enterPassword,
|
hintText: L10().enterPassword,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: _obscured ? FaIcon(FontAwesomeIcons.eye) : FaIcon(FontAwesomeIcons.solidEyeSlash),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
_obscured = !_obscured;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
initialValue: profile?.password ?? "",
|
initialValue: profile?.password ?? "",
|
||||||
keyboardType: TextInputType.visiblePassword,
|
keyboardType: TextInputType.visiblePassword,
|
||||||
obscureText: true,
|
obscureText: _obscured,
|
||||||
onSaved: (value) {
|
onSaved: (value) {
|
||||||
password = value ?? "";
|
password = value ?? "";
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue