setIgnorePointer method

  1. @override
  2. @protected
void setIgnorePointer(
  1. bool value
)
override

Whether the contents of the widget should ignore PointerEvent inputs.

Setting this value to true prevents the use from interacting with the contents of the widget with pointer events. The widget itself is still interactive.

For example, if the scroll position is being driven by an animation, it might be appropriate to set this value to ignore pointer events to prevent the user from accidentally interacting with the contents of the widget as it animates. The user will still be able to touch the widget, potentially stopping the animation.

Implementation

@override
@protected
void setIgnorePointer(bool value) {
  if (_shouldIgnorePointer == value) {
    return;
  }
  _shouldIgnorePointer = value;
  if (_ignorePointerKey.currentContext != null) {
    final RenderIgnorePointer renderBox = _ignorePointerKey.currentContext!.findRenderObject()! as RenderIgnorePointer;
    renderBox.ignoring = _shouldIgnorePointer;
  }
}