Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of ripple effect TextButton Flutter

Tags:

flutter

Ever since Flutter deprecated the FlatButton, I can no longer use splashColor and highlightColor properties to set the color of my buttons when the user presses down on them. Now I have to use one of the new buttons, such as TextButton below, but I have yet to find any buttonStyles that have a feature where the background color, for when the user presses down on the button, does not have the ripple effect.

TextButton(
 style: ButtonStyle(
  overlayColor: MaterialStateProperty.all(Colors.grey[100]),
 ),
),
like image 706
James 666 Avatar asked Oct 20 '25 15:10

James 666


1 Answers

A late reply, you can use splashFactory property on ButtonStyle.

TextButton(
  style: TextButton.styleFrom(
    splashFactory: NoSplash.splashFactory
  ),
),
like image 93
Victor Kwok Avatar answered Oct 23 '25 05:10

Victor Kwok