如何隐藏悬停颤振网页上的菜单



我一直面临一个问题与扑动网页。当我悬停项目时,我显示菜单但是当我的鼠标移出项目时如何隐藏菜单

查看此视频

Container(
key: menuKey,
color: Colors.lightBlueAccent,
constraints: const BoxConstraints(
minWidth: 100,
minHeight: 50,
),
child: MouseRegion(
onExit: (event) {},
onHover: (event) {
final render = menuKey.currentContext!.findRenderObject()
as RenderBox;
showMenu(
context: context,
position: RelativeRect.fromLTRB(
render.localToGlobal(Offset.zero).dx,
render.localToGlobal(Offset.zero).dy + 50,
double.infinity,
double.infinity),
items: [
const PopupMenuItem(
child: Text("Create a website"),
),
const PopupMenuItem(
child: Text("Top Ms commericial management"),
),
const PopupMenuItem(
child: Text("Mobile inventory application"),
),
],
);
},
child: const Text('Solutions'),
),
),

使用mouseregition小部件,您可以获得onHover和onExit通知

相关内容

  • 没有找到相关文章

最新更新