【发布时间】:2020-07-11 20:06:00
【问题描述】:
在documentation 中,RaisedButton 有一个属性“enableFeedback”,用于控制“检测到的手势是否应提供声音和/或触觉反馈”。
我正在尝试在我的 Androd 应用程序中设置 enableFeedback: false,但 RaisedButton 似乎不存在此属性。我收到以下错误:Error: No named parameter with the name 'enableFeedback'.
文档有错吗?
我想要做的是防止我的应用在点击凸起按钮时播放声音(它现在正在这样做)。
编辑: Workaround here。使用 MaterialButton 而不是 RaisedButton。 MaterialButton 确实有一个 enableFeedback 属性。不过,这并不完美,因为 RaisedButton 具有更好的默认样式(例如 disabledColor)。
【问题讨论】:
标签: flutter