英文:
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应用。下面是图片链接:
我已经尝试了多种方法,比如:
- CupertinoContextMenu(CupertinoContextMenuAction)只在长按(轻按)时起作用,我不想要那样。我希望用户可以通过单次轻按来触发它。
- 将它包裹在一个手势检测器中,但这不起作用。
- 使用模态表单,但我不想要那样。我只想要一个弹出菜单。
请告诉我是否有任何方法可以通过单次轻按触发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
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 包。
英文:
Unfortunately, you need to take the code of _ContextMenuRoute
and adapt it to your needs.
Or use pull_down_button package
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论