【发布时间】:2018-02-12 22:11:31
【问题描述】:
我正在构建我的第一个 Flutter 应用,我想创建一个简单的布局:一个背景图像和一个半透明的材质按钮。
我的 Widget 树非常简单,但 InkWell / Ripple 不可见。为什么我会有这种行为?
class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Material(
child: new Stack(
children: <Widget>[
new Container(
decoration: new BoxDecoration(
image: new DecorationImage(
image: new AssetImage("res/imgs/splashscreen_bg.png"),
fit: BoxFit.cover,
))),
new Center(
child: new FlatButton(
onPressed: () {}, child: new Text("Hello world")))
],
),
);
}
}
没有背景图片,InkWell 可以工作。 我该怎么办?
谢谢
【问题讨论】: