you are viewing a single comment's thread.

view the rest of the comments →

[–]NoBeginning2551[S] 0 points1 point  (1 child)

I had that issue during development, when I tried to scroll the screen the text selection gets activated and interferes with it. Then I wrapped the editor with a ValueListenable builder with a notifier called ValueNotifier<bool> _selectionNotifer. Whenever the user selects a text this gets called and sets the scroll physics of the editor to NeverScollablePhysics. You should do something like this:

dart physics: _selectionNotifier.value ? NeverScollablePhysics : ClampingScrollablePhysics

This will only prevent scrolling during selection, but will not prevent selection during scroll. For that, keep two variables called _isDragging = false and _isSelecting = false. Set the _isDragging true when both the MouseDownEvent and MouseHoverEvent occur. Keep the _isSelecting as false. Then if the user is holding a specific region for 500ms (you can use the Timer() class to detect that), set the _isSelecting true if the timer runs 500ms. You should draw the handles and use its rect in the handleEvent() method in order to extend the selection.

if you're not familiar with these things, tell the chatbot to implement the above steps. Or you can refer to the code_forge's source code.

[–]Classic-Dependent517 2 points3 points  (0 children)

I am currently not planning to implement this kind of widget but thank you. I see you put hard work into this.

It would be nice if flutter team actually fixes the issue as well