Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
cb9e9a37
Unverified
Commit
cb9e9a37
authored
Mar 09, 2022
by
Kate Lovett
Committed by
GitHub
Mar 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated RenderEditable.onSelectionChanged (#98582)
parent
574173bb
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
172 deletions
+34
-172
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+0
-41
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+0
-11
editable_gesture_test.dart
packages/flutter/test/rendering/editable_gesture_test.dart
+0
-1
editable_test.dart
packages/flutter/test/rendering/editable_test.dart
+34
-119
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
cb9e9a37
...
...
@@ -30,17 +30,6 @@ const EdgeInsets _kFloatingCaretSizeIncrease = EdgeInsets.symmetric(horizontal:
// The corner radius of the floating cursor in pixels.
const
Radius
_kFloatingCaretRadius
=
Radius
.
circular
(
1.0
);
/// Signature for the callback that reports when the user changes the selection
/// (including the cursor location).
///
/// Used by [RenderEditable.onSelectionChanged].
@Deprecated
(
'Signature of a deprecated class method, '
'textSelectionDelegate.userUpdateTextEditingValue. '
'This feature was deprecated after v1.26.0-17.2.pre.'
,
)
typedef
SelectionChangedHandler
=
void
Function
(
TextSelection
selection
,
RenderEditable
renderObject
,
SelectionChangedCause
cause
);
/// Signature for the callback that reports when the caret location changes.
///
/// Used by [RenderEditable.onCaretChanged].
...
...
@@ -265,11 +254,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
double
textScaleFactor
=
1.0
,
TextSelection
?
selection
,
required
ViewportOffset
offset
,
@Deprecated
(
'Uses the textSelectionDelegate.userUpdateTextEditingValue instead. '
'This feature was deprecated after v1.26.0-17.2.pre.'
,
)
this
.
onSelectionChanged
,
this
.
onCaretChanged
,
this
.
ignorePointer
=
false
,
bool
readOnly
=
false
,
...
...
@@ -501,14 +485,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
],
);
}
/// Called when the selection changes.
///
/// If this is null, then selection changes will be ignored.
@Deprecated
(
'Uses the textSelectionDelegate.userUpdateTextEditingValue instead. '
'This feature was deprecated after v1.26.0-17.2.pre.'
,
)
SelectionChangedHandler
?
onSelectionChanged
;
double
?
_textLayoutLastMaxWidth
;
double
?
_textLayoutLastMinWidth
;
...
...
@@ -731,7 +707,6 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
}
void
_setTextEditingValue
(
TextEditingValue
newValue
,
SelectionChangedCause
cause
)
{
textSelectionDelegate
.
textEditingValue
=
newValue
;
textSelectionDelegate
.
userUpdateTextEditingValue
(
newValue
,
cause
);
}
...
...
@@ -751,28 +726,12 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
extentOffset:
math
.
min
(
nextSelection
.
extentOffset
,
textLength
),
);
}
_handleSelectionChange
(
nextSelection
,
cause
);
_setTextEditingValue
(
textSelectionDelegate
.
textEditingValue
.
copyWith
(
selection:
nextSelection
),
cause
,
);
}
void
_handleSelectionChange
(
TextSelection
nextSelection
,
SelectionChangedCause
cause
,
)
{
// Changes made by the keyboard can sometimes be "out of band" for listening
// components, so always send those events, even if we didn't think it
// changed. Also, focusing an empty field is sent as a selection change even
// if the selection offset didn't change.
final
bool
focusingEmpty
=
nextSelection
.
baseOffset
==
0
&&
nextSelection
.
extentOffset
==
0
&&
!
hasFocus
;
if
(
nextSelection
==
selection
&&
cause
!=
SelectionChangedCause
.
keyboard
&&
!
focusingEmpty
)
{
return
;
}
onSelectionChanged
?.
call
(
nextSelection
,
this
,
cause
);
}
@override
void
markNeedsPaint
()
{
super
.
markNeedsPaint
();
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
cb9e9a37
...
...
@@ -965,17 +965,6 @@ mixin TextSelectionDelegate {
/// Gets the current text input.
TextEditingValue
get
textEditingValue
;
/// Indicates that the user has requested the delegate to replace its current
/// text editing state with [value].
///
/// The new [value] is treated as user input and thus may subject to input
/// formatting.
@Deprecated
(
'Use the userUpdateTextEditingValue instead. '
'This feature was deprecated after v1.26.0-17.2.pre.'
,
)
set
textEditingValue
(
TextEditingValue
value
)
{}
/// Indicates that the user has requested the delegate to replace its current
/// text editing state with [value].
///
...
...
packages/flutter/test/rendering/editable_gesture_test.dart
View file @
cb9e9a37
...
...
@@ -32,7 +32,6 @@ void main() {
extentOffset:
3
,
affinity:
TextAffinity
.
upstream
,
),
onSelectionChanged:
(
_
,
__
,
___
)
{
},
);
editable
.
layout
(
BoxConstraints
.
loose
(
const
Size
(
1000.0
,
1000.0
)));
...
...
packages/flutter/test/rendering/editable_test.dart
View file @
cb9e9a37
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment