diff --git a/lib/views/addeditprofileview.dart b/lib/views/addeditprofileview.dart index a493f563..93a10ccb 100644 --- a/lib/views/addeditprofileview.dart +++ b/lib/views/addeditprofileview.dart @@ -163,6 +163,7 @@ class _AddEditProfileViewState extends State { ), CwtchPasswordField( controller: ctrlrOldPass, + autoFillHints: [AutofillHints.newPassword], validator: (value) { // Password field can be empty when just updating the profile, not on creation if (Provider.of(context).isEncrypted && Provider.of(context, listen: false).onion.isEmpty && value.isEmpty && usePassword) { diff --git a/lib/widgets/passwordfield.dart b/lib/widgets/passwordfield.dart index c48b5ef2..4cf061b8 100644 --- a/lib/widgets/passwordfield.dart +++ b/lib/widgets/passwordfield.dart @@ -4,14 +4,17 @@ import 'package:provider/provider.dart'; import '../settings.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +const hints = [AutofillHints.password]; + // Provides a styled Password Input Field for use in Form Widgets. // Callers must provide a text controller, label helper text and a validator. class CwtchPasswordField extends StatefulWidget { - CwtchPasswordField({required this.controller, required this.validator, this.action, this.autofocus = false}); + CwtchPasswordField({required this.controller, required this.validator, this.action, this.autofocus = false, this.autoFillHints = hints}); final TextEditingController controller; final FormFieldValidator validator; final Function(String)? action; final bool autofocus; + final Iterable autoFillHints; @override _CwtchTextFieldState createState() => _CwtchTextFieldState(); @@ -34,6 +37,7 @@ class _CwtchTextFieldState extends State { controller: widget.controller, validator: widget.validator, obscureText: obscureText, + autofillHints: widget.autoFillHints, autovalidateMode: AutovalidateMode.always, onFieldSubmitted: widget.action, textInputAction: TextInputAction.unspecified,