Flutter Desktop: How to disable "disabled" mouse-cursor on button-hover?

Issue

By default, on Desktop, btns in flutter change the Mouse Cursor when they are disabled:

enter image description here

We’d like to disable this behavior, or replace with a different cursor.

Solution

To override the default disabledMouseCursor for ElevatedButton, TextButton or OutlinedButton, one could write:

        ElevatedButton(
          style: ElevatedButton.styleFrom(
            disabledMouseCursor: SystemMouseCursors.basic,
          ),
          // ...
        )

See ButtonStyle class for more information.

Answered By – Spatz

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *