ExtendedMouseRegion class
ExtendedMouseRegion is a stateful widget that allows you to handle mouse events and update the mouse cursor without rebuilding the child widget. This widget provides a method to change the cursor dynamically, ensuring only the cursor is rebuilt while the child remains unchanged.
This is useful for scenarios where you need to dynamically change the cursor style in response to user interactions without affecting the underlying widget tree.
The onEnter, onExit, and onHover parameters allow you to handle mouse events. The initCursor parameter sets the initial cursor style, the opaque parameter specifies whether the region is opaque, and the hitTestBehavior parameter defines the hit test behavior. The child parameter is the widget to be enclosed within the mouse region.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ExtendedMouseRegion
Constructors
- ExtendedMouseRegion.new({Key? key, PointerEnterEventListener? onEnter, PointerExitEventListener? onExit, PointerHoverEventListener? onHover, MouseCursor initCursor = MouseCursor.defer, bool opaque = true, HitTestBehavior? hitTestBehavior, required Widget child})
-
const
Properties
- child → Widget
-
The widget to be enclosed within the mouse region.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hitTestBehavior → HitTestBehavior?
-
The behavior during hit testing.
final
- initCursor → MouseCursor
-
The cursor to display when the mouse is over the region.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onEnter → PointerEnterEventListener?
-
Callback when the mouse enters the region.
final
- onExit → PointerExitEventListener?
-
Callback when the mouse exits the region.
final
- onHover → PointerHoverEventListener?
-
Callback when the mouse hovers over the region.
final
- opaque → bool
-
Whether the region is opaque.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ExtendedMouseRegion> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited