Flutter 如何在颤振中禁用提升的按钮单击动画?

Flutter 如何在颤振中禁用提升的按钮单击动画?,flutter,dart,Flutter,Dart,在某些情况下,我试图禁用raisedButton。单击时的动画不会消失 将持续时间设置为0不起作用 升起的按钮 孩子:情况怎么样文本…':, 新闻界:{ trueCondition=!trueCondition; ... }, 动画持续时间:trueCondition?持续毫秒:700:Durationseconds:0, 如果bool值为true,则检查条件,如果您将传递null,则onPressed将为null,RaisedButton将被禁用,您还可以提供禁用的颜色 onPressed:

在某些情况下,我试图禁用raisedButton。单击时的动画不会消失

将持续时间设置为0不起作用

升起的按钮 孩子:情况怎么样文本…':, 新闻界:{ trueCondition=!trueCondition; ... }, 动画持续时间:trueCondition?持续毫秒:700:Durationseconds:0,
如果bool值为true,则检查条件,如果您将传递null,则onPressed将为null,RaisedButton将被禁用,您还可以提供禁用的颜色

onPressed: trueCondition?(){
trueCondition = !trueCondition;
  }: null

通过将“spash和highlight color”设置为“透明”,可以删除点击动画

MaterialButton(
              splashColor: Colors.transparent,
              highlightColor: Colors.transparent,
              enableFeedback: false,
              onPressed: null,
           ),

你找到这个问题的答案了吗?我想在一定时间内禁用按钮。你能帮我做这个的代码吗?