在Flutter应用栏中,如何使用Cupertino包创建类似iOS的带有3个点的弹出菜单?

huangapple go评论52阅读模式
英文:

How can I create a 3 dot pop-up menu in the Flutter app bar similar to iOS with using a Cupertino package for iOS?

问题

如何在Flutter应用程序栏中创建一个类似iOS的3点弹出菜单,我不想使用Material包,因为我正在开发iOS应用。下面是图片链接:

图片链接

我已经尝试了多种方法,比如:

  1. CupertinoContextMenu(CupertinoContextMenuAction)只在长按(轻按)时起作用,我不想要那样。我希望用户可以通过单次轻按来触发它。
  2. 将它包裹在一个手势检测器中,但这不起作用。
  3. 使用模态表单,但我不想要那样。我只想要一个弹出菜单。

请告诉我是否有任何方法可以通过单次轻按触发CupertinoContextMenuAction,或者是否有其他方法也可以帮助解决这个问题。

谢谢。

英文:

How to make a 3 dot pop-up menu in the app bar in Flutter like ios. I do not want to use a material package cause developing for ios. Image link below

Image here

I have already tried multiple things like 1. CupertinoContextMenu (CupertinoContextMenuAction) only work on long press(tap) and I don't want that. I want it with a single tap on the user. 2. Wrapped it inside a gesture detector but it does not work. 3. Used modal sheet but I don't want it like that. I want just a popup menu

Please tell me if there are any methods to Trigger CupertinoContextMenuAction with a single tap or any different methods that will also help

Thanks.

答案1

得分: 0

很抱歉,你需要获取 _ContextMenuRoute 的代码并根据你的需求进行调整。

或者使用 pull_down_button 包。

在Flutter应用栏中,如何使用Cupertino包创建类似iOS的带有3个点的弹出菜单?

英文:

Unfortunately, you need to take the code of _ContextMenuRoute and adapt it to your needs.

Or use pull_down_button package

在Flutter应用栏中,如何使用Cupertino包创建类似iOS的带有3个点的弹出菜单?

huangapple
  • 本文由 发表于 2023年5月22日 20:44:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76306332.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定