flutter - Flutter AutofillHints oneTimeCode 不起作用
问题描述
我想捕捉 OTP 短信代码,但它在 IOS 上不起作用。我需要显示键盘上方的代码。
我的代码块是;
TextField(
controller: controller,
autofillHints: const <String>[AutofillHints.oneTimeCode],
keyboardType: TextInputType.number,
onChanged: onChanged,
),
解决方案
来自https://master-api.flutter.dev/flutter/material/TextField/autofillHints.html上的 Flutter 文档“某些自动填充提示仅适用于特定的键盘类型”。尝试更改键盘类型。例如:
TextField(
controller: controller,
autofillHints: const <String>[AutofillHints.oneTimeCode],
keyboardType: TextInputType.text,
onChanged: onChanged,
),
推荐阅读
- javascript - React 组件工作正常,但尝试使用 useMemo() 会导致错误
- java - 使用 jar 文件在临时文件夹中创建 excel 文件时,Excel 文件已损坏
- python - python看门狗跟踪来自另一个进程的单个文件更改在检测到更改时失败
- ruby-on-rails - 未定义的局部变量或方法 `permitted_task_attributes' for #
我有一个遵循 Spree/Solidus 范式的解决方案,它封装了允许的参数。我没有能力改变它,而是效仿。但是,我遇到了一个问题,我无法重现 #Api::V1::TasksController:0x0000000000b7c0 的未定义局部变量或方法“permitted_task_attributes”。
- python - 如何在 for 循环中附加熊猫数据框,同时在第一列上进行累积和?
- javascript - 使用 regex machers 加速和简化多个 if/else
- javascript - 基于年月组合的对象组数组
- python - 跨 MRI 切片的最大池化
- java - 在 Java 中将 String 转换为 HashSet
- .net - 如何使用 LabVIEW .NET 构造函数节点在 Grpc.Core.Api.dll 中创建 Channel Credentials 对象?