initMouseTracker method

  1. @visibleForTesting
void initMouseTracker([
  1. MouseTracker? tracker
])

Creates a MouseTracker which manages state about currently connected mice, for hover notification.

Used by testing framework to reinitialize the mouse tracker between tests.

Implementation

@visibleForTesting
void initMouseTracker([MouseTracker? tracker]) {
  _mouseTracker?.dispose();
  _mouseTracker = tracker ?? MouseTracker((Offset position, int viewId) {
    final HitTestResult result = HitTestResult();
    hitTestInView(result, position, viewId);
    return result;
  });
}