Disable FlatButton sound on tap (Flutter)

我们两清 提交于 2020-12-08 07:58:04

问题


Im making an app that play sounds when you press FlatButtons, and I want to disable the predetermined pop sound that plays every time you touch the screen.

Is there a way to do this?


回答1:


you cant disable the sound for the flatbutton .you can use InkWell() Widget it offers you the methode enableFeedback . you can set it as false and you should be alright




回答2:


Use MaterialButton. All the styling remains the same but you have the added benefit of implementing

enableFeedback: false,
which will remove the default click sound.


回答3:


One of the idea is to use InkWell() widget instead.

Refer: How to mute the sound of buttons in application?



来源:https://stackoverflow.com/questions/57585225/disable-flatbutton-sound-on-tap-flutter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!