flutter - 这是我的错误如何解决?当我单击文本字段时出现此错误
问题描述
这是我的代码
appBar: AppBar(
title: Card(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
margin: EdgeInsets.only(left: 20,top: 20,bottom: 20,),
child: TextField(
autofocus: false,
style: TextStyle(
fontSize: 20),
decoration: InputDecoration(hintText: 'گەڕان',
border: InputBorder.none,
disabledBorder: InputBorder.none,
suffixIcon: IconButton(
onPressed: () => _searchInputController.clear(),
icon: Icon(Icons.clear),
),
contentPadding: EdgeInsets.only(left: 10.0,right: 5.0,top: 10.0)),
onSubmitted: (value) {
_filterList(value);
},
controller: _searchInputController,
),
),
),
解决方案
这个bug我也有一段时间了。这似乎是一个内部 Flutter 错误,我们无能为力。我认为您可以通过更改 TextField 的内部结构来绕过它,但这不值得付出努力,因为该错误不会造成任何不良后果。
由于 Flutter 2 我不再有这个错误,也许尝试更新。
推荐阅读
- jquery - 如何在 jquery 中实现 fa-bars
- javascript - 具有有效 CSS 规则的空样式元素?
- mysql - 什么是替代连接查询
- xml - transformer.setOutputProperty() 没有生效 - java 8
- android - 如何从 FCM 令牌中获取 Firebase 用户 ID?(在服务器上的管理代码中)
- python - Keras - 恢复特定时间戳的 LSTM 隐藏状态
- python - 没有使用瞭望塔将正确的日志记录(python)格式发送到 Cloudwatch
- python - 在 Django 中正确使用自定义标签时遇到问题
- java - 如何为我的线程处理程序方法设置超时?
- sql - 在 SQL Server 2017 中创建目录