|
|
|
@ -515,7 +515,7 @@ class EmailInput extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class PasswordInput extends StatelessWidget {
|
|
|
|
class PasswordInput extends HookConsumerWidget {
|
|
|
|
final TextEditingController controller;
|
|
|
|
final TextEditingController controller;
|
|
|
|
final FocusNode? focusNode;
|
|
|
|
final FocusNode? focusNode;
|
|
|
|
final Function()? onSubmit;
|
|
|
|
final Function()? onSubmit;
|
|
|
|
@ -528,9 +528,11 @@ class PasswordInput extends StatelessWidget {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
|
|
|
final isPasswordVisible = useState<bool>(false);
|
|
|
|
|
|
|
|
|
|
|
|
return TextFormField(
|
|
|
|
return TextFormField(
|
|
|
|
obscureText: true,
|
|
|
|
obscureText: !isPasswordVisible.value,
|
|
|
|
controller: controller,
|
|
|
|
controller: controller,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
labelText: 'login_form_label_password'.tr(),
|
|
|
|
labelText: 'login_form_label_password'.tr(),
|
|
|
|
@ -540,6 +542,14 @@ class PasswordInput extends StatelessWidget {
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
|
|
|
onPressed: () => isPasswordVisible.value = !isPasswordVisible.value,
|
|
|
|
|
|
|
|
icon: Icon(
|
|
|
|
|
|
|
|
isPasswordVisible.value
|
|
|
|
|
|
|
|
? Icons.visibility_off_sharp
|
|
|
|
|
|
|
|
: Icons.visibility_sharp,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
autofillHints: const [AutofillHints.password],
|
|
|
|
autofillHints: const [AutofillHints.password],
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|