Skip to content

MouseRegion

Reports the pointer entering, moving within, and leaving its child. Hover requires motion tracking (TerminalMode.mouseMotion); without it, enter/exit still fire on clicks.

Learn more: Input & gestures

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

MouseRegion(
onEnter: () => setHover(true),
onExit: () => setHover(false),
child: Text('hover me'),
)
ParameterTypeDefaultDescription
onEnter:PointerTapCallback?—Called when the pointer enters the child’s painted bounds.
onExit:PointerTapCallback?—Called when the pointer leaves the child’s painted bounds.
onHover:PointerCallback?—Called on pointer motion with coordinates relative to this region and the surface.
onScroll:PointerScrollCallback?—Return true to consume the wheel step, false to offer it to an ancestor.
cursor:MouseCursor?—Overrides the host’s pointer shape inside this region. Null lets the host use its ordinary control cursor. Descendant controls can override it.
child:WidgetrequiredSubtree whose painted bounds define the hover region.

MouseRegion is defined in packages/fleury/lib/src/widgets/pointer.dart.

Category: Input handling & focus · All widgets