Implement SelectionArea triple click gestures (#144563)

This change adds support for triple click to select a paragraph at the clicked position and triple click + drag to extend the selection paragraph-by-paragraph when using the SelectionArea widget.

This PR also:
* Makes `Text` widgets a `SelectionContainer` if a parent `SelectionRegistrar` exists.
* Fixes issues with selectable ordering involving `WidgetSpan`s.

Fixes: https://github.com/flutter/flutter/issues/104552
This commit is contained in:
Renzo Olivares
2024-04-02 14:10:52 -07:00
committed by GitHub
parent 6fe56362e5
commit 2a37c6f307
9 changed files with 2438 additions and 227 deletions

View File

@@ -185,6 +185,7 @@ class _RenderSelectableAdapter extends RenderProxyBox with Selectable, Selection
_start = _end = null;
case SelectionEventType.selectAll:
case SelectionEventType.selectWord:
case SelectionEventType.selectParagraph:
_start = Offset.zero;
_end = Offset.infinite;
case SelectionEventType.granularlyExtendSelection: