pub struct MouseTrackerAnnotation {
pub on_enter: Option<PointerEnterEventListener>,
pub on_exit: Option<PointerExitEventListener>,
pub cursor: MouseCursorRef,
pub valid_for_mouse_tracker: bool,
}Expand description
The annotation object used to annotate regions that are interested in mouse movements.
To use an annotation, return this object as a HitTestTarget in a hit test.
Typically this is done using a RenderMouseRegion.
The MouseTracker uses this class as a label to filter the hit test results.
Only hit test targets that have this annotation as their target will receive
mouse events.
Dart’s constructor takes named optional arguments; write
MouseTrackerAnnotation { on_enter: Some(..), ..Default::default() }.
Fields§
§on_enter: Option<PointerEnterEventListener>Triggered when a mouse pointer, with or without buttons pressed, has
entered the region and valid_for_mouse_tracker is true.
This callback is triggered when the pointer has started to be contained by
the region, either due to a pointer event, or due to the movement or
disappearance of the region. This method is always matched by a later
on_exit.
on_exit: Option<PointerExitEventListener>Triggered when a mouse pointer, with or without buttons pressed, has
exited the region and valid_for_mouse_tracker is true.
This callback is triggered when the pointer has stopped being contained
by the region, either due to a pointer event, or due to the movement or
disappearance of the region. This method always matches an earlier
on_enter.
cursor: MouseCursorRefThe mouse cursor for mouse pointers that are hovering over the region.
When a mouse enters the region, its cursor will be changed to the cursor.
When the mouse leaves the region, the cursor will be set by the region
found at the new location.
Defaults to MouseCursor.defer, deferring the choice of cursor to the next
region behind it in hit-test order.
valid_for_mouse_tracker: boolWhether this is included when a MouseTracker collects the list of
annotations.
If valid_for_mouse_tracker is false, this
object is excluded from the current annotation list even if it’s included
in the hit test, affecting mouse-related behavior such as enter events,
exit events, and mouse cursors. The valid_for_mouse_tracker does not
affect hit testing.
Defaults to true.