Flutter-Web: Mouse hover -> Change cursor to pointer

前端 未结 8 1491
走了就别回头了
走了就别回头了 2021-02-05 06:59

How can the cursor appearance be changed within Flutter? I know that with the Listener() Widget we can listen for Mouse-Events, but I haven\'t found any information regarding h

8条回答
  •  名媛妹妹
    2021-02-05 07:16

    I had difficulties finding documentation on the now built-in support. Here is what helped me: https://github.com/flutter/flutter/issues/58260

    And this did the trick for me, without changing index.html etc.

    MouseRegion(
      cursor: SystemMouseCursors.click,
        child: GestureDetector(
          child: Icon(
            Icons.add_comment,
            size: 20,
            ),
          onTap: () {},
        ),
      ),
    

提交回复
热议问题