flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.36k stars 27.29k forks source link

Add continuous swipe to CupertinoContextMenu #117936

Open manuthebyte opened 1 year ago

manuthebyte commented 1 year ago

As I described in #117698, to make the CupertinoContextMenu feel like 100% native, there is one major function that's missing. In iOS, if you leave your finger on some object with a ContextMenu, you can swipe through the options. But since we don't have an onHover function on Mobile in Flutter, it isn't that easy (I think).

The problem is that the original onTap is being cancelled because the DecoyChild is being created. So maybe if we can pass the event on, this would work.

Example of what I mean: Here I am leaving my finger on the blue square and can now swipe through the options and when I let go on one, it gets selected.

https://user-images.githubusercontent.com/71405615/210454143-52d7f3c1-aacf-4865-9f85-3b3ef6053b57.MP4

moffatman commented 1 year ago

I agree for sure. I have my own version (https://github.com/moffatman/flutter/commit/5a8b944a6c9754e1d7cf0751746e5bd5ca6808fe) I use in my app but it is quite lazily implemented, doesn't have continuous swipe to select (i only use continuous swipe for dismiss), and isn't updated for the recent CupertinoContextMenu changes. To start with, it would be great to have a change like https://github.com/moffatman/flutter/commit/364ae510c7fdc78924bb7367f8d6492243450d3b, so more complex cancellable Route animations and transitions can be implemented.

jmagman commented 1 year ago

cc @MitchellGoodwin in case you weren't subscribed https://github.com/flutter/flutter/pull/117698#issuecomment-1370068368