feat(auth): password visibility

This commit is contained in:
mso7nueh
2024-10-04 12:11:54 +03:00
parent 1217c72f2f
commit 15f435e958
11 changed files with 231 additions and 13 deletions

View File

@@ -37,6 +37,7 @@ class AuthScreen extends StatefulWidget {
class _AuthScreenState extends State<AuthScreen> {
bool checkboxState = false;
bool hidePassword = true;
@override
Widget build(BuildContext context) {
@@ -73,9 +74,20 @@ class _AuthScreenState extends State<AuthScreen> {
selector: (state) => state.passwordController,
builder: (context, passwordController) {
return CustomTextFormField(
obscureText: true,
obscureText: hidePassword,
controller: passwordController,
hintText: 'Введите пароль',
suffix: IconButton(
onPressed: () {
setState(() {
hidePassword = !hidePassword;
});
},
icon: Icon(
hidePassword ? Icons.visibility_outlined : Icons.visibility_off_outlined,
color: Colors.grey,
),
),
);
},
),