Flutter Desktop:如何禁用按钮悬停时的“禁用”鼠标光标?

sha*_*ais 2 flutter flutter-desktop

默认情况下,在桌面上,flutter 中的 btns 在禁用时会更改鼠标光标:

在此输入图像描述

我们想禁用此行为,或替换为不同的光标。

Spa*_*atz 5

要覆盖, 或 的默认disabledMouseCursor 可以编写:ElevatedButtonTextButtonOutlinedButton

        ElevatedButton(
          style: ElevatedButton.styleFrom(
            disabledMouseCursor: SystemMouseCursors.basic,
          ),
          // ...
        )
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅ButtonStyle 类。