updateMouseCursor method
Recomputes the effective mouse cursor for the scrollbar and updates the active cursor if it has changed.
Subclasses should call this after changes to state that affect cursor resolution (for example, when entering or leaving a drag).
Implementation
@protected
@mustCallSuper
void updateMouseCursor() {
// The wrapping MouseRegion covers the entire scrollable viewport rather
// than just the scrollbar painter. Therefore, _hoverIsActive is used to
// gate the cursor override to the painted scrollbar track/thumb; otherwise
// MouseCursor.defer is used to preserve ancestor cursors (e.g. the
// EditableText I-beam).
final MouseCursor? resolved = widget.mouseCursor?.resolve(cursorStates);
final MouseCursor desired = ((_hoverIsActive || _dragIsActive) && resolved != null)
? resolved
: MouseCursor.defer;
if (desired != _effectiveMouseCursor) {
setState(() {
_effectiveMouseCursor = desired;
});
}
}