flutter - 点击 IconButton() 时移除点击效果
问题描述
我目前正在使用以下代码IconButton()
在 Flutter 中创建一个:
IconButton(
hoverColor: Colors.transparent,
color: _tweenButton.value,
icon: Icon(Icons.send),
onPressed: () => _isComposing ? _handleSubmitted(_textController.text) : null,
)
每当我单击图标按钮时,都会出现如此屏幕截图所示的飞溅/单击效果。这个小部件在MaterialApp()
和Scaffold()
.
如何停用此视觉效果?
解决方案
使用此代码:
IconButton(
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
color: _tweenButton.value,
icon: Icon(Icons.send),
onPressed: () => _isComposing ? _handleSubmitted(_textController.text) : null,
)
推荐阅读
- vert.x - Vert.x 响应路径处理程序示例
- c# - Response.Redirect 并导致 System.Threading.ThreadAbortException?
- visual-studio - 错误:“Visual Studio Community 2017 产品已安装在此文件夹中。需要选择其他位置。”
- regex - How do I write a Regular Expression to match any three digits except 2 numbers?
- reactjs - 我应该将组件中定义的所有函数包装在 useCallback 中吗?
- xslt - XSLT 中的日期格式转换
- c# - 从 Azure 存储中获取 blob 文件名的最快方法
- excel - 检查行中的条件,然后打印列值
- java - 当缺少消息键时,如何使 Spring Boot 默认为语言环境?
- python-3.x - 使用带有包含选项的 xpath 单击按钮