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?
FlatButton is the material design widget in flutter. It is a text label material widget that performs an action when the button is tapped. Let’s understand with the help of examples. Disclamer: As of May 2021 the FlatButton class in flutter is deprecated.
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 Use MaterialButton. All the styling remains the same but you have the added benefit of implementing
All the styling remains the same but you have the added benefit of implementing which will remove the default click sound. Good suggestion! Flatbutton is deprecated in Flutter 2. MaterialButton is the best substitute for it. Thanks! One of the idea is to use InkWell () widget instead.
There's a detailed migration guide for the new button and button theme classes in flutter.dev/go/material-button-migration-guide. @ Deprecated ('Use TextButton instead. See the migration guide in flutter.dev/go/material-button-migration-guide). ' 'This feature was deprecated after v1.26.0-18.0.pre.') Create a simple text button. [...]
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With