Skip to content

Commit

Permalink
add: ability to show password
Browse files Browse the repository at this point in the history
  • Loading branch information
HarlJo committed Apr 7, 2024
1 parent 9b2fdf7 commit 762e9ef
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/settings/_account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class SettingsAccountFragment extends StatefulWidget {

class _SettingsAccountFragment extends State<SettingsAccountFragment> {
var multiFactorController = TextEditingController();
bool hidePassword = true;

@override
Widget build(BuildContext context) {
var model = context.read<WebFlowAuthModel>();
Expand Down Expand Up @@ -56,7 +58,7 @@ class _SettingsAccountFragment extends State<SettingsAccountFragment> {
),
Flexible(
child: PrefText(
obscureText: true,
obscureText: hidePassword,
label: '',
pref: optionPasswordTwitterAcc,
//style: const TextStyle(fontSize: 16,height:1),
Expand All @@ -69,6 +71,12 @@ class _SettingsAccountFragment extends State<SettingsAccountFragment> {
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(width: 1, color: Theme.of(context).colorScheme.primary),
),
suffix: InkWell(
onTap: () => setState(() => hidePassword = !hidePassword),
child: Icon(
hidePassword ? Icons.visibility : Icons.visibility_off,
),
),
),
),
),
Expand Down

0 comments on commit 762e9ef

Please sign in to comment.