Flutter FlatButton不显示点击动画/波纹效果

时间:2018-12-30 14:47:44

标签: dart flutter

我有以下代码:

return new ListTile(
                          leading: new CircleAvatar(
                              backgroundColor: Colors.blue,
                              child: new Image.network(
                                  "http://res.cloudinary.com/kennyy/image/upload/v1531317427/avatar_z1rc6f.png")),
                          title: new Row(
                            children: <Widget>[
                              new Expanded(child: new Text(message)),
                              new FlatButton(onPressed: null, child: new Text("Delete"))
                            ]
                          ),
                          subtitle: new Text(from),
                        );

在我的ListView中创建了一个图块。 每个磁贴应有一个按钮。 当我点击按钮时-我实际上看不到任何波纹效果或动画。我非常确定它是Material主题的一部分,作为FlatButtons的手势,但是我尝试使用InkWell找到了解决方案:

return new ListTile(
                          leading: new CircleAvatar(
                              backgroundColor: Colors.blue,
                              child: new Image.network(
                                  "http://res.cloudinary.com/kennyy/image/upload/v1531317427/avatar_z1rc6f.png")),
                          title: new Row(
                            children: <Widget>[
                              new Expanded(child: new Text(message)),
                              InkWell(
                                  child: FlatButton(onPressed: null, child: new Text("Delete"), color: Colors.amber))
                            ]
                          ),
                          subtitle: new Text(from),
                        );

但是仍然-点击时,我的列表视图按钮没有任何波纹效果。

有什么主意吗?

0 个答案:

没有答案