[单击IconButton()时删除单击效果

问题描述 投票:0回答:1

我目前正在使用以下代码在Flutter中创建IconButton()

IconButton(
  hoverColor: Colors.transparent,
  color: _tweenButton.value,
  icon: Icon(Icons.send),
  onPressed: () => _isComposing ? _handleSubmitted(_textController.text) : null,
)

[每当我单击图标按钮时,就会出现in this screenshot所示的飞溅/单击效果。此小部件正在MaterialApp()Scaffold()内部运行。

如何停用此视觉效果?

flutter
1个回答
0
投票

使用此代码:

IconButton(
 splashColor: Colors.transparent,
 highlightColor: Colors.transparent,  
 color: _tweenButton.value,
 icon: Icon(Icons.send),
 onPressed: () => _isComposing ? _handleSubmitted(_textController.text) : null,
)

© www.soinside.com 2019 - 2024. All rights reserved.