doonfrs / pluto_grid_plus

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
27 stars 28 forks source link

Manually detect doubleTaps on desktop platform to eliminate delay #84

Closed AminBhst closed 1 month ago

AminBhst commented 1 month ago

This PR addresses #83. As you can see below, manual detection of double taps inside of onTapUp removes the significant single tap delay which is caused by Flutter's doubleTap detection on desktop. There is currently an issue from 2 years ago that asks for a fix on the SDK level, however, it doesn't seem to be coming anytime soon. So I think a workaround for this issue is the best course of action for now.

Before

before

After

after

doonfrs commented 1 month ago

Great effort @AminBhst thank you! it was merged 🙏🙏

anzbert commented 2 weeks ago

I actually wish I could use it on mobile as well

AminBhst commented 2 weeks ago

@anzbert It could be done pretty easily but I think it's better to have it be configurable. Something like: ManualDoubleTapDetectionPlatform.desktop, ManualDoubleTapDetectionPlatform.mobile, ManualDoubleTapDetectionPlatform.all, ManualDoubleTapDetectionPlatform.none

The code is already there so you can just add a configuration entry for this purpose and open a PR. Pretty straightforward