hitTestInteractive method

bool hitTestInteractive (Offset position)

Same as hitTest, but includes some padding to make sure that the region isn't too small to be interacted with by the user.

Implementation

bool hitTestInteractive(Offset position) {
  if (_thumbRect == null) {
    return false;
  }
  // The thumb is not able to be hit when transparent.
  if (fadeoutOpacityAnimation.value == 0.0) {
    return false;
  }
  final Rect interactiveThumbRect = _thumbRect.expandToInclude(
    Rect.fromCircle(center: _thumbRect.center, radius: _kMinInteractiveSize / 2),
  );
  return interactiveThumbRect.contains(position);
}