Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove click effect when IconButton() is clicked

Tags:

flutter

dart

I am currently using the following code to create an IconButton() in Flutter:

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

Whenever I click on the icon button, there is a splash/click effect as depicted in this screenshot. This widget is running inside MaterialApp() and Scaffold().

How can I deactivate this visual effect?

like image 273
cfanatic Avatar asked Jun 12 '26 00:06

cfanatic


1 Answers

Use this code:

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

like image 111
KKRocks Avatar answered Jun 15 '26 07:06

KKRocks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!