Closed chenjuyu closed 4 years ago
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.70. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
如果要在onTap里面使用Navigator.push,那么先设置isTapClosePopover为false,然后在里面先执行Navigator.pop
我试一下吧,但是我已经改了你代码了,如果要引用这个,任何页面都不需要加这些了 cupertino_popover_menu_item.dart 这个文件中
if(widget.isTapClosePopover){ Navigator.of(context).pop(); } if(widget.onTap != null && widget.onTap()){ return; }把widget.isTapClosePopover 这个判断 放在判断 onTap是否为空的上面,就都可以了,如果你觉得可以,可以修改一下你的组件,个人建议 ------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2019年11月26日(星期二) 晚上9:42 收件人: "Im-Kevin/cool_ui"<cool_ui@noreply.github.com>; 抄送: "CHEN"<2498525982@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [Im-Kevin/cool_ui] popover 菜单 关不掉问题 (#33)
如果要在onTap里面使用Navigator.push,那么先设置isTapClosePopover为false,然后在里面先执行Navigator.pop
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
这样确实可以解决你的那个问题,但是会出现builder里面的context 无法使用的问题,所以我这里暂时还不会改的
好吧 那就用你说的这种方法吧,如下确实可以返回,只不过要多写些代码而已 return CupertinoPopoverMenuItem(child: Text(poplist[i],style: TextStyle(height: 2.0),textAlign: TextAlign.center,), onTap: (){
print('aaa:'+poplist[i]); Navigator.push(context, MaterialPageRoute(builder: (context)=>baseCheck(TableTag:poplist[i]))).then((val){ print('返回的值:'+val.toString()); Navigator.pop(context); }); return true;
}, isTapClosePopover: false, );
------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2019年12月1日(星期天) 中午11:43 收件人: "Im-Kevin/cool_ui"<cool_ui@noreply.github.com>; 抄送: "CHEN"<2498525982@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [Im-Kevin/cool_ui] popover 菜单 关不掉问题 (#33)
这样确实可以解决你的那个问题,但是会出现builder里面的context 无法使用的问题,所以我这里暂时还不会改的
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
点击菜单到下一个界面后,如何让返回到当前界面时,把 菜单关掉啊,返回时,还是显示菜单的, 点击后到下一个界面,无论是按返回建还是pop结果 有无结果返回,都应该关掉弹出菜单才对啊! 是我设置问题,还是哪里的问题
` return CupertinoPopoverMenuList(