【发布时间】:2020-05-14 19:50:17
【问题描述】:
尝试使用 InkWell 功能(onHover)放大我的图片(使用 ClipPath 剪辑),但是当我悬停图片时没有任何反应。
InkWell(
onTap: () {},
onHover: (isHovering) {
if (isHovering) {
setState(() {
sizeBool = !sizeBool;
});
}
},
child: ClipPath(
child: AnimatedContainer(
duration: Duration(seconds: 1),
width: MediaQuery.of(context).size.width,
height: sizeBool ? 450 : 150,
child: Image.network(
'image.url',
fit: BoxFit.cover,
),
),
clipper: CustomClipPath(),
),
)
],
)
],
),
),
),
);
}
}
【问题讨论】:
-
你能给 InkWell 的父母看吗?
-
检查我的答案你可以使用这个获得悬停效果:stackoverflow.com/a/63780118/5370550
标签: flutter