I want to remove the ripple effect from a transparent clickable container but no matter what I do the effect just doesn't go away, please help!
Code:
InkWell(
onTap: (){print('Tapped');},
child: Container(
height: 200, width: 200,),)
I want to remove the ripple effect from a transparent clickable container but no matter what I do the effect just doesn't go away, please help!
Code:
InkWell(
onTap: (){print('Tapped');},
child: Container(
height: 200, width: 200,),)
Put Following Line in Your Material App Widget ThemeData
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
Like
theme: ThemeData(
highlightColor: Colors.transparent,
hoverColor: Colors.transparent,
splashColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
)
I use it like this:
InkWell(
excludeFromSemantics: true,
canRequestFocus: false,
enableFeedback: false,
splashFactory: NoSplash.splashFactory,
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
overlayColor: MaterialStateProperty.all(Colors.transparent),
onTap: widget.onPressed,
child: child,
);
Use GestureDetector
instead of InkWell
because Inkwell provide by default ripple effect, So you can use GestureDetector.