• Tong Mu's avatar
    Remove single view assumption from MouseTracker, and unify its hit testing code flow (#127060) · ab3c5bfc
    Tong Mu authored
    This is a refactor to make `MouseTracker` use the same callback for both kinds of device update. Instead of using two different callbacks for the two device updating methods, `MouseTracker` now receives a hit testing callback at construction, which is the same hit testing method as the one used for other gestures.
    
    This PR not only makes the code cleaner, but also removes the single view assumption from `MouseTracker`, whose code no longer refers to `RendererBinding.renderView`. In the future, we only need to modify `hitTest` (which we will have to do to support gestures for multi-view anyway) to make mouse tracker support multi-view.
    ab3c5bfc
mouse_tracker.dart 17 KB