mouseCursor method

NikuButton mouseCursor({
  1. MouseCursor? base,
  2. MouseCursor? disabled,
  3. MouseCursor? dragged,
  4. MouseCursor? error,
  5. MouseCursor? focused,
  6. MouseCursor? hovered,
  7. MouseCursor? pressed,
  8. MouseCursor? selected,
})

Set cursor when hovered on widget

Equivalent to

TextButton(
  cursor: MaterialStateProperty.resolveWith<T>((states) {
    if (states.contains(MaterialState.disabled)) return disabled;
    if (states.contains(MaterialState.dragged)) return dragged;
    if (states.contains(MaterialState.error)) return error;
    if (states.contains(MaterialState.focused)) return focused;
    if (states.contains(MaterialState.hovered)) return hovered;
    if (states.contains(MaterialState.pressed)) return pressed;
    if (states.contains(MaterialState.selected)) return selected;

    return base;
  });
)

Implementation

NikuButton mouseCursor({
  MouseCursor? base,
  MouseCursor? disabled,
  MouseCursor? dragged,
  MouseCursor? error,
  MouseCursor? focused,
  MouseCursor? hovered,
  MouseCursor? pressed,
  MouseCursor? selected,
}) {
  this._mouseCursor.update(
        base: base,
        disabled: disabled,
        dragged: dragged,
        error: error,
        focused: focused,
        hovered: hovered,
        pressed: pressed,
        selected: selected,
      );

  return this;
}