简体   繁体   中英

How to remove blue shadow on textbutton when it's pressed (Flutter)

I'd like to remove the shadow that appears when you press a text button on Flutter, I've looked everywhere and can't find an answer ! Help me please ! Thank you !

You should check the documentation of TextButton and especially the styleButtonStyle . You need to change the overlayColor as per documentation:

The highlight color that's typically used to indicate that the button is focused, hovered, or pressed.

Instead of using TextButton, I recommend you to use Text Widget using GestureDetector. So the Text is there is no shadow color.

Example:

GestureDetector(
    child: Text('Click me'),
    onTap: () {},
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM