【问题标题】:Flutter AutofillHints oneTimeCode doesn't workFlutter AutofillHints oneTimeCode 不起作用
【发布时间】:2021-04-29 04:22:31
【问题描述】:

我想捕捉 OTP 短信代码,但它在 IOS 上不起作用。 我需要显示键盘上方的代码。

我的代码块是;

TextField(
 controller: controller,
 autofillHints: const <String>[AutofillHints.oneTimeCode],
 keyboardType: TextInputType.number,
 onChanged: onChanged,
),

【问题讨论】:

    标签: flutter dart textfield one-time-password


    【解决方案1】:

    来自https://master-api.flutter.dev/flutter/material/TextField/autofillHints.html 的 Flutter 文档@“一些自动填充提示仅适用于特定的键盘类型”。尝试更改键盘类型。例如:

    TextField(
     controller: controller,
     autofillHints: const <String>[AutofillHints.oneTimeCode],
     keyboardType: TextInputType.text,
     onChanged: onChanged,
    ),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-22
      • 2020-03-11
      • 1970-01-01
      • 2020-02-06
      • 1970-01-01
      • 2021-05-17
      • 2021-11-18
      • 2018-09-17
      相关资源
      最近更新 更多