From 44849ab46a6eb1bc2ab7dc9f1339f4b6e405b133 Mon Sep 17 00:00:00 2001 From: Justin McCandless Date: Mon, 10 Jan 2022 10:06:08 -0800 Subject: [PATCH] Document the default -1,-1 selection (#96245) Clarify in the docs about what an invalid selection means, contrasted with a 0,0 selection. --- packages/flutter/lib/src/services/text_input.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index f546c36ab0..aaddbf579c 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -744,6 +744,9 @@ class TextEditingValue { /// /// The [text], [selection], and [composing] arguments must not be null but /// each have default values. + /// + /// The default value of [selection] is `TextSelection.collapsed(offset: -1)`. + /// This indicates that there is no selection at all. const TextEditingValue({ this.text = '', this.selection = const TextSelection.collapsed(offset: -1),