开发者

Change cursor to Hand icon when hover over the menu item in popup

开发者 https://www.devze.com 2022-12-07 18:37 出处:网络
I need to show handicon when hover over the menu items.I tried with SystemMouseCursors.click but it didn\'t works.It still show cursor

I need to show handicon when hover over the menu items.I tried with SystemMouseCursors.click but it didn't works.It still show cursor

Change cursor to Hand icon when hover over the menu item in popup

void showPopUpMenuAtTap(BuildContext context, TapDownDetails details,controller) {
    showMenu(
      context: context,
      position: RelativeRect.fromLTRB(
        details.globalPosition.dx,
        details.globalPosition.dy,
        details.globalPosition.dx,
        details.globalPosition.dy,
      ), items: [
      PopupMenuItem<String>(
        mouseCursor: SystemMouseCursors.click,

        padding: EdgeInsets.zero,

          child: ListTile(
            minLeadingWidth : 10,
            leading:SvgPicture.asset(Images.deleteGreyIcon), // your icon
            title: Text("Delete"),
          ), value: '1'),
      PopupMenuItem<String>(
          mouseCursor:MouseCursor.uncontrolled,

          paddin开发者_StackOverflow中文版g: EdgeInsets.zero,
          child: ListTile(
            minLeadingWidth : 10,
            leading: SvgPicture.asset(Images.editIcon), // your icon
            title: Text("Rename"),
          ), value: '2'),

    ],
      elevation: 3.0,).then((value) {
      if (value == null) return;
      if(value == "1"){

       }else if(value == "2"){
      
      }

    });
    

  }


Wrap the ListTile with MouseRegion:

MouseRegion(
      cursor: SystemMouseCursors.click,
      child: ListTile(...),
          ),

0

精彩评论

暂无评论...
验证码 换一张
取 消