Flutter:密码自动填充
Flutter: password autofill
我正在寻找一种方法来为登录表单中的密码文本字段启用自动填充
作为备份解决方案,我想将密码保存在安全存储中,然后在执行新登录时使用生物识别技术恢复相同的密码。
但这不会涵盖 iOS 12 中的所有自动填充密码体验。
例如,密码不会在多个设备上保存。
有什么建议吗?
开箱即用的 flutter 尚不支持自动填充。我知道有两个问题正在跟踪这个问题(尽管 android 相关)。您可能想要 subscribe/vote 那些:
我担心通过第 3 方插件触发此功能并不容易。
关于您关于安全存储的问题:如果您使用 flutter secure storage plugin,它使用 iOS 上的钥匙串,它应该通过 iCloud 在设备之间同步。
Flutter 现在支持自动填充(密码、电子邮件、用户名等) ☑️ 带有示例的合并拉取请求:https://github.com/flutter/flutter/pull/52126
示例:
@override
Widget build(BuildContext context) {
return AutofillGroup(
child: Column(
children: <Widget>[
TextField(controller: username, autofillHints: [AutofillHints.username]),
Checkbox(
value: isNewUser,
onChanged: (bool newValue) {
setState(() { isNewUser = newValue; });
},
),
if (isNewUser) TextField(controller: newPassword, autofillHints: [AutofillHints.newPassword]),
if (isNewUser) TextField(controller: repeatNewPassword, autofillHints: [AutofillHints.newPassword]),
if (!isNewUser) TextField(controller: password, autofillHints: [AutofillHints.password]),
],
),
);
}
我在同一页面上的电子邮件输入和密码输入都有自动填充功能。自动填充仅显示在密码字段中。
我必须将 TextFields 包装在 AutoFillGroup 中,以便它们在两者上显示!
我正在寻找一种方法来为登录表单中的密码文本字段启用自动填充
作为备份解决方案,我想将密码保存在安全存储中,然后在执行新登录时使用生物识别技术恢复相同的密码。
但这不会涵盖 iOS 12 中的所有自动填充密码体验。 例如,密码不会在多个设备上保存。
有什么建议吗?
开箱即用的 flutter 尚不支持自动填充。我知道有两个问题正在跟踪这个问题(尽管 android 相关)。您可能想要 subscribe/vote 那些:
我担心通过第 3 方插件触发此功能并不容易。
关于您关于安全存储的问题:如果您使用 flutter secure storage plugin,它使用 iOS 上的钥匙串,它应该通过 iCloud 在设备之间同步。
Flutter 现在支持自动填充(密码、电子邮件、用户名等) ☑️ 带有示例的合并拉取请求:https://github.com/flutter/flutter/pull/52126
示例:
@override
Widget build(BuildContext context) {
return AutofillGroup(
child: Column(
children: <Widget>[
TextField(controller: username, autofillHints: [AutofillHints.username]),
Checkbox(
value: isNewUser,
onChanged: (bool newValue) {
setState(() { isNewUser = newValue; });
},
),
if (isNewUser) TextField(controller: newPassword, autofillHints: [AutofillHints.newPassword]),
if (isNewUser) TextField(controller: repeatNewPassword, autofillHints: [AutofillHints.newPassword]),
if (!isNewUser) TextField(controller: password, autofillHints: [AutofillHints.password]),
],
),
);
}
我在同一页面上的电子邮件输入和密码输入都有自动填充功能。自动填充仅显示在密码字段中。
我必须将 TextFields 包装在 AutoFillGroup 中,以便它们在两者上显示!