MaterialStateMouseCursor typedef

  1. @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.')
MaterialStateMouseCursor = WidgetStateMouseCursor

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.

This example defines a mouse cursor that resolves to SystemMouseCursors.forbidden when its widget is disabled.
link

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:

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;