MaterialStateMouseCursor typedef
- @Deprecated('Use WidgetStateMouseCursor instead. ' 'Moved to the Widgets layer to make code available outside of Material. ' 'This feature was deprecated after v3.19.0-0.3.pre.')
Defines a MouseCursor whose value depends on a set of MaterialStates which represent the interactive state of a component.
This kind of MouseCursor is useful when the set of interactive actions a widget supports varies with its state. For example, a mouse pointer hovering over a disabled ListTile should not display SystemMouseCursors.click, since a disabled list tile doesn't respond to mouse clicks. ListTile's default mouse cursor is a MaterialStateMouseCursor.clickable, which resolves to SystemMouseCursors.basic when the button is disabled.
To use a MaterialStateMouseCursor, you should create a subclass of
MaterialStateMouseCursor and implement the abstract resolve
method.
To create a local project with this code sample, run:
flutter create --sample=material.MaterialStateMouseCursor.1 mysample
This class should only be used for parameters which are documented to take MaterialStateMouseCursor, otherwise only the default state will be used.
See also:
- WidgetStateMouseCursor, the non-Material version that can be used
interchangeably with
MaterialStateMouseCursor
. - MouseCursor for introduction on the mouse cursor system.
- SystemMouseCursors, which defines cursors that are supported by native platforms.
Implementation
@Deprecated(
'Use WidgetStateMouseCursor instead. '
'Moved to the Widgets layer to make code available outside of Material. '
'This feature was deprecated after v3.19.0-0.3.pre.'
)
typedef MaterialStateMouseCursor = WidgetStateMouseCursor;