Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable FlatButton sound on tap (Flutter)

Tags:

flutter

dart

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?

like image 466
Tapioca Avatar asked Aug 21 '19 05:08

Tapioca


People also ask

What is flatbutton in flutter?

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.

How do I disable the sound for the flat 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 Use MaterialButton. All the styling remains the same but you have the added benefit of implementing

Is it possible to remove the default click sound in flutter?

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.

Is there a migration guide for Button and button theme in flutter?

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. [...]


1 Answers

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

like image 159
Mohamed hassan kadri Avatar answered Sep 20 '22 14:09

Mohamed hassan kadri