isPointerOverTrack method Null safety

  1. @protected
bool isPointerOverTrack(
  1. Offset position,
  2. PointerDeviceKind kind
)
protected">@protected

Returns true if the provided Offset is located over the track of the RawScrollbar.

Excludes the RawScrollbar thumb.

Implementation

@protected
bool isPointerOverTrack(Offset position, PointerDeviceKind kind) {
  if (_scrollbarPainterKey.currentContext == null) {
    return false;
  }
  final Offset localOffset = _getLocalOffset(_scrollbarPainterKey, position);
  return scrollbarPainter.hitTestInteractive(localOffset, kind)
    && !scrollbarPainter.hitTestOnlyThumbInteractive(localOffset, kind);
}