mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-14 16:09:31 +01:00
fix: Password not obscure for a second when submitting login textfield
This commit is contained in:
parent
1c0a17056f
commit
38d65ba3ed
@ -27,7 +27,8 @@ class LoginController extends State<Login> {
|
||||
bool loading = false;
|
||||
bool showPassword = false;
|
||||
|
||||
void toggleShowPassword() => setState(() => showPassword = !showPassword);
|
||||
void toggleShowPassword() =>
|
||||
setState(() => showPassword = !loading && !showPassword);
|
||||
|
||||
void login([_]) async {
|
||||
final matrix = Matrix.of(context);
|
||||
|
@ -58,16 +58,16 @@ class LoginView extends StatelessWidget {
|
||||
autofillHints:
|
||||
controller.loading ? null : [AutofillHints.password],
|
||||
controller: controller.passwordController,
|
||||
textInputAction: TextInputAction.next,
|
||||
textInputAction: TextInputAction.go,
|
||||
obscureText: !controller.showPassword,
|
||||
onSubmitted: controller.login,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.lock_outlined),
|
||||
errorText: controller.passwordError,
|
||||
errorStyle: const TextStyle(color: Colors.orange),
|
||||
suffixIcon: InkWell(
|
||||
onTap: controller.toggleShowPassword,
|
||||
child: Icon(
|
||||
suffixIcon: IconButton(
|
||||
onPressed: controller.toggleShowPassword,
|
||||
icon: Icon(
|
||||
controller.showPassword
|
||||
? Icons.visibility_off_outlined
|
||||
: Icons.visibility_outlined,
|
||||
|
Loading…
Reference in New Issue
Block a user