flutter - 输入文本后点击 Flutter 集成测试中的 enter/done/return 按钮
问题描述
await tester.enterText(mySearchField, 'my search text');
await tester.showKeyboard(mySearchField);
await tester.sendKeyDownEvent(LogicalKeyboardKey.enter);
// do something to wait for 2 seconds
await tester.pumpAndSettle();
await Future.delayed(const Duration(seconds: 10), () {});
在搜索字段中输入文本后,我正在尝试点击虚拟键盘上的完成/输入/提交按钮。
如何做到这一点,以及如何等待结果(异步请求)......
解决方案
推荐阅读
- android - 如何在 Android 中用线条和三角形一起绘制球体?
- javascript - 获取 Mailgun 'ERR_HTTP_HEADERS_SENT'
- python - pip install pyodbc 在 python 上不起作用
- r - 使用 plotly 更改图表上的字体
- node.js - Node.js 中的多线程:如何从路由器返回响应,但在单独的线程中执行其他操作?
- java - 尝试显示来自 Firebase 的数据,但没有显示
- python - 在线程中传递参数而不调用 - 如何将 Flask 服务器放入线程中
- azure - Azure Powershell 函数使用推送输出绑定附加到 Blob
- html - 如何使用带有链接 id 和 div id 的悬停
- redux - 如何配置效果协调器以使用 redux-offline 将错误传递给回滚?