草庐IT

GestureDetectors

全部标签

flutter - 覆盖子 GestureDetectors 的 GestureDetector?

有没有办法让GestureDetector覆盖所有子GestureDetectors的功能?我有一个复杂的小部件,我希望能够轻松地在较高级别覆盖它的所有行为。例如,将免费用户锁定在功能之外。 最佳答案 要暂时禁用所有子手势检测器,请使用IgnorePointer小部件:@overrideWidgetbuild(BuildContextcontext){boolignoreChildGestures=true;returnGestureDetector(onTap:(){print('parenttapped');},child:Ig

flutter - 覆盖子 GestureDetectors 的 GestureDetector?

有没有办法让GestureDetector覆盖所有子GestureDetectors的功能?我有一个复杂的小部件,我希望能够轻松地在较高级别覆盖它的所有行为。例如,将免费用户锁定在功能之外。 最佳答案 要暂时禁用所有子手势检测器,请使用IgnorePointer小部件:@overrideWidgetbuild(BuildContextcontext){boolignoreChildGestures=true;returnGestureDetector(onTap:(){print('parenttapped');},child:Ig