text selection affinity can be null on web (#62778)
This commit is contained in:
parent
2b51ac6f35
commit
e3c3d6eb7e
@ -594,7 +594,7 @@ class TextInputConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
TextAffinity? _toTextAffinity(String affinity) {
|
||||
TextAffinity? _toTextAffinity(String? affinity) {
|
||||
switch (affinity) {
|
||||
case 'TextAffinity.downstream':
|
||||
return TextAffinity.downstream;
|
||||
@ -662,7 +662,7 @@ class TextEditingValue {
|
||||
selection: TextSelection(
|
||||
baseOffset: encoded['selectionBase'] as int? ?? -1,
|
||||
extentOffset: encoded['selectionExtent'] as int? ?? -1,
|
||||
affinity: _toTextAffinity(encoded['selectionAffinity'] as String) ?? TextAffinity.downstream,
|
||||
affinity: _toTextAffinity(encoded['selectionAffinity'] as String?) ?? TextAffinity.downstream,
|
||||
isDirectional: encoded['selectionIsDirectional'] as bool? ?? false,
|
||||
),
|
||||
composing: TextRange(
|
||||
|
Loading…
x
Reference in New Issue
Block a user