|
|
|
@ -25,12 +25,10 @@ enum _TextSelectionHandlePosition { START, END } |
|
|
|
|
|
|
|
|
|
/// internal use, used to get drag direction information |
|
|
|
|
class DragTextSelection extends TextSelection { |
|
|
|
|
final bool first; |
|
|
|
|
|
|
|
|
|
const DragTextSelection({ |
|
|
|
|
TextAffinity affinity = TextAffinity.downstream, |
|
|
|
|
int baseOffset = 0, |
|
|
|
|
int extentOffset = 0, |
|
|
|
|
TextAffinity affinity = TextAffinity.downstream, |
|
|
|
|
bool isDirectional = false, |
|
|
|
|
this.first = true, |
|
|
|
|
}) : super( |
|
|
|
@ -40,6 +38,8 @@ class DragTextSelection extends TextSelection { |
|
|
|
|
isDirectional: isDirectional, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
final bool first; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
DragTextSelection copyWith({ |
|
|
|
|
int? baseOffset, |
|
|
|
@ -191,7 +191,7 @@ class EditorTextSelectionOverlay { |
|
|
|
|
default: |
|
|
|
|
throw 'Invalid position'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final currSelection = newSelection != null |
|
|
|
|
? DragTextSelection( |
|
|
|
|
baseOffset: newSelection.baseOffset, |
|
|
|
@ -201,7 +201,7 @@ class EditorTextSelectionOverlay { |
|
|
|
|
first: position == _TextSelectionHandlePosition.START, |
|
|
|
|
) |
|
|
|
|
: null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectionDelegate |
|
|
|
|
..userUpdateTextEditingValue( |
|
|
|
|
value.copyWith(selection: currSelection, composing: TextRange.empty), |
|
|
|
|