如何防止在Flutter中连续单击InkWell按钮2次?



我正在使用InkWell小部件来添加可点击性,但是我遇到了以下问题:当我双击一个按钮时,我同时打开了两个窗口。如何禁用快速按下按钮连续2次的能力?

Container(
width: 72,
decoration: const BoxDecoration(
color: Colors.transparent,
),
alignment: Alignment.center,
child: InkWell(
onTap: onTap,

你试过这个方法吗?

InkWell( onTap: onTap, onDoubleTap: (){}, )

最新更新