【发布时间】:2018-06-12 11:24:05
【问题描述】:
当用户点击磁贴时,我正在尝试使用InkWell 在GridTile 内的图像顶部获得涟漪效果。
我相信图像本身会掩盖波纹,因为当我移除图像时,我会看到波纹。
以下是单个 GridTile 的代码。
return new InkWell(
onTap: () => debugPrint(s.displayName),
highlightColor: Colors.pinkAccent,
splashColor: Colors.greenAccent,
child: new GridTile(
footer: new GridTileBar(
title: new Text(s.displayName),
subtitle: new Text(s.gameName),
backgroundColor: Colors.black45,
trailing: new Icon(
Icons.launch,
color: Colors.white,
),
),
child: new Image.network( //this is obscuring the InkWell ripple
s.imageSrc,
fit: BoxFit.cover,
),
),
);
我尝试将 InkWell 移动到层次结构的不同级别,在 Container 中使用 DecorationImage,但这些似乎都无法揭示涟漪。
如何让波纹出现在图块/图像的顶部?
【问题讨论】:
-
尽管有层次结构,但 Image 确实比 InkWell 具有更高的高度,这很奇怪
标签: flutter