hitTest method

  1. @override
GDisplayObject? hitTest(
  1. GPoint localPoint, [
  2. bool useShape = false
])
override

Determines whether the specified localPoint is within the bounds of this icon.

This implementation is specific to GIcon and only tests whether the point is within the local bounds of the icon.

Implementation

@override
GDisplayObject? hitTest(GPoint localPoint, [bool useShape = false]) {
  if (!visible || !mouseEnabled) {
    return null;
  }
  return _localBounds.containsPoint(localPoint) ? this : null;
}