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
baf86869
Unverified
Commit
baf86869
authored
Jun 28, 2022
by
Justin McCandless
Committed by
GitHub
Jun 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently capitalize Endpoint (not EndPoint) (#106706)
parent
bbdf6170
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
selectable_region.dart
packages/flutter/lib/src/widgets/selectable_region.dart
+2
-2
text_selection.dart
packages/flutter/lib/src/widgets/text_selection.dart
+14
-14
text_selection_test.dart
packages/flutter/test/widgets/text_selection_test.dart
+6
-6
No files found.
packages/flutter/lib/src/widgets/selectable_region.dart
View file @
baf86869
...
@@ -514,7 +514,7 @@ class _SelectableRegionState extends State<SelectableRegion> with TextSelectionD
...
@@ -514,7 +514,7 @@ class _SelectableRegionState extends State<SelectableRegion> with TextSelectionD
onEndHandleDragStart:
_handleSelectionEndHandleDragStart
,
onEndHandleDragStart:
_handleSelectionEndHandleDragStart
,
onEndHandleDragUpdate:
_handleSelectionEndHandleDragUpdate
,
onEndHandleDragUpdate:
_handleSelectionEndHandleDragUpdate
,
onEndHandleDragEnd:
(
DragEndDetails
details
)
=>
_stopSelectionEndEdgeUpdate
(),
onEndHandleDragEnd:
(
DragEndDetails
details
)
=>
_stopSelectionEndEdgeUpdate
(),
selectionEnd
P
oints:
points
,
selectionEnd
p
oints:
points
,
selectionControls:
widget
.
selectionControls
,
selectionControls:
widget
.
selectionControls
,
selectionDelegate:
this
,
selectionDelegate:
this
,
clipboardStatus:
null
,
clipboardStatus:
null
,
...
@@ -550,7 +550,7 @@ class _SelectableRegionState extends State<SelectableRegion> with TextSelectionD
...
@@ -550,7 +550,7 @@ class _SelectableRegionState extends State<SelectableRegion> with TextSelectionD
..
lineHeightAtStart
=
start
?.
lineHeight
??
end
!.
lineHeight
..
lineHeightAtStart
=
start
?.
lineHeight
??
end
!.
lineHeight
..
endHandleType
=
end
?.
handleType
??
TextSelectionHandleType
.
right
..
endHandleType
=
end
?.
handleType
??
TextSelectionHandleType
.
right
..
lineHeightAtEnd
=
end
?.
lineHeight
??
start
!.
lineHeight
..
lineHeightAtEnd
=
end
?.
lineHeight
??
start
!.
lineHeight
..
selectionEnd
P
oints
=
points
;
..
selectionEnd
p
oints
=
points
;
}
}
/// Shows the selection handles.
/// Shows the selection handles.
...
...
packages/flutter/lib/src/widgets/text_selection.dart
View file @
baf86869
...
@@ -258,7 +258,7 @@ class TextSelectionOverlay {
...
@@ -258,7 +258,7 @@ class TextSelectionOverlay {
onEndHandleDragStart:
_handleSelectionEndHandleDragStart
,
onEndHandleDragStart:
_handleSelectionEndHandleDragStart
,
onEndHandleDragUpdate:
_handleSelectionEndHandleDragUpdate
,
onEndHandleDragUpdate:
_handleSelectionEndHandleDragUpdate
,
toolbarVisible:
_effectiveToolbarVisibility
,
toolbarVisible:
_effectiveToolbarVisibility
,
selectionEnd
P
oints:
const
<
TextSelectionPoint
>[],
selectionEnd
p
oints:
const
<
TextSelectionPoint
>[],
selectionControls:
selectionControls
,
selectionControls:
selectionControls
,
selectionDelegate:
selectionDelegate
,
selectionDelegate:
selectionDelegate
,
clipboardStatus:
clipboardStatus
,
clipboardStatus:
clipboardStatus
,
...
@@ -373,7 +373,7 @@ class TextSelectionOverlay {
...
@@ -373,7 +373,7 @@ class TextSelectionOverlay {
)
)
..
lineHeightAtEnd
=
_getEndGlyphHeight
()
..
lineHeightAtEnd
=
_getEndGlyphHeight
()
// Update selection toolbar metrics.
// Update selection toolbar metrics.
..
selectionEnd
P
oints
=
renderObject
.
getEndpointsForSelection
(
_selection
)
..
selectionEnd
p
oints
=
renderObject
.
getEndpointsForSelection
(
_selection
)
..
toolbarLocation
=
renderObject
.
lastSecondaryTapDownPosition
;
..
toolbarLocation
=
renderObject
.
lastSecondaryTapDownPosition
;
}
}
...
@@ -589,7 +589,7 @@ class SelectionOverlay {
...
@@ -589,7 +589,7 @@ class SelectionOverlay {
this
.
onEndHandleDragUpdate
,
this
.
onEndHandleDragUpdate
,
this
.
onEndHandleDragEnd
,
this
.
onEndHandleDragEnd
,
this
.
toolbarVisible
,
this
.
toolbarVisible
,
required
List
<
TextSelectionPoint
>
selectionEnd
P
oints
,
required
List
<
TextSelectionPoint
>
selectionEnd
p
oints
,
required
this
.
selectionControls
,
required
this
.
selectionControls
,
required
this
.
selectionDelegate
,
required
this
.
selectionDelegate
,
required
this
.
clipboardStatus
,
required
this
.
clipboardStatus
,
...
@@ -603,7 +603,7 @@ class SelectionOverlay {
...
@@ -603,7 +603,7 @@ class SelectionOverlay {
_lineHeightAtStart
=
lineHeightAtStart
,
_lineHeightAtStart
=
lineHeightAtStart
,
_endHandleType
=
endHandleType
,
_endHandleType
=
endHandleType
,
_lineHeightAtEnd
=
lineHeightAtEnd
,
_lineHeightAtEnd
=
lineHeightAtEnd
,
_selectionEnd
Points
=
selectionEndP
oints
,
_selectionEnd
points
=
selectionEndp
oints
,
_toolbarLocation
=
toolbarLocation
{
_toolbarLocation
=
toolbarLocation
{
final
OverlayState
?
overlay
=
Overlay
.
of
(
context
,
rootOverlay:
true
);
final
OverlayState
?
overlay
=
Overlay
.
of
(
context
,
rootOverlay:
true
);
assert
(
assert
(
...
@@ -721,13 +721,13 @@ class SelectionOverlay {
...
@@ -721,13 +721,13 @@ class SelectionOverlay {
final
ValueListenable
<
bool
>?
toolbarVisible
;
final
ValueListenable
<
bool
>?
toolbarVisible
;
/// The text selection positions of selection start and end.
/// The text selection positions of selection start and end.
List
<
TextSelectionPoint
>
get
selectionEnd
Points
=>
_selectionEndP
oints
;
List
<
TextSelectionPoint
>
get
selectionEnd
points
=>
_selectionEndp
oints
;
List
<
TextSelectionPoint
>
_selectionEnd
P
oints
;
List
<
TextSelectionPoint
>
_selectionEnd
p
oints
;
set
selectionEnd
P
oints
(
List
<
TextSelectionPoint
>
value
)
{
set
selectionEnd
p
oints
(
List
<
TextSelectionPoint
>
value
)
{
if
(!
listEquals
(
_selectionEnd
P
oints
,
value
))
{
if
(!
listEquals
(
_selectionEnd
p
oints
,
value
))
{
_markNeedsBuild
();
_markNeedsBuild
();
}
}
_selectionEnd
P
oints
=
value
;
_selectionEnd
p
oints
=
value
;
}
}
/// Debugging information for explaining why the [Overlay] is required.
/// Debugging information for explaining why the [Overlay] is required.
...
@@ -800,7 +800,7 @@ class SelectionOverlay {
...
@@ -800,7 +800,7 @@ class SelectionOverlay {
/// The location of where the toolbar should be drawn in relative to the
/// The location of where the toolbar should be drawn in relative to the
/// location of [toolbarLayerLink].
/// location of [toolbarLayerLink].
///
///
/// If this is null, the toolbar is drawn based on [selectionEnd
P
oints] and
/// If this is null, the toolbar is drawn based on [selectionEnd
p
oints] and
/// the rect of render object of [context].
/// the rect of render object of [context].
///
///
/// This is useful for displaying toolbars at the mouse right-click locations
/// This is useful for displaying toolbars at the mouse right-click locations
...
@@ -988,19 +988,19 @@ class SelectionOverlay {
...
@@ -988,19 +988,19 @@ class SelectionOverlay {
renderBox
.
localToGlobal
(
renderBox
.
size
.
bottomRight
(
Offset
.
zero
)),
renderBox
.
localToGlobal
(
renderBox
.
size
.
bottomRight
(
Offset
.
zero
)),
);
);
final
bool
isMultiline
=
selectionEnd
Points
.
last
.
point
.
dy
-
selectionEndP
oints
.
first
.
point
.
dy
>
final
bool
isMultiline
=
selectionEnd
points
.
last
.
point
.
dy
-
selectionEndp
oints
.
first
.
point
.
dy
>
lineHeightAtEnd
/
2
;
lineHeightAtEnd
/
2
;
// If the selected text spans more than 1 line, horizontally center the toolbar.
// If the selected text spans more than 1 line, horizontally center the toolbar.
// Derived from both iOS and Android.
// Derived from both iOS and Android.
final
double
midX
=
isMultiline
final
double
midX
=
isMultiline
?
editingRegion
.
width
/
2
?
editingRegion
.
width
/
2
:
(
selectionEnd
Points
.
first
.
point
.
dx
+
selectionEndP
oints
.
last
.
point
.
dx
)
/
2
;
:
(
selectionEnd
points
.
first
.
point
.
dx
+
selectionEndp
oints
.
last
.
point
.
dx
)
/
2
;
final
Offset
midpoint
=
Offset
(
final
Offset
midpoint
=
Offset
(
midX
,
midX
,
// The y-coordinate won't be made use of most likely.
// The y-coordinate won't be made use of most likely.
selectionEnd
P
oints
.
first
.
point
.
dy
-
lineHeightAtStart
,
selectionEnd
p
oints
.
first
.
point
.
dy
-
lineHeightAtStart
,
);
);
return
Directionality
(
return
Directionality
(
...
@@ -1012,7 +1012,7 @@ class SelectionOverlay {
...
@@ -1012,7 +1012,7 @@ class SelectionOverlay {
editingRegion:
editingRegion
,
editingRegion:
editingRegion
,
selectionControls:
selectionControls
,
selectionControls:
selectionControls
,
midpoint:
midpoint
,
midpoint:
midpoint
,
selectionEndpoints:
selectionEnd
P
oints
,
selectionEndpoints:
selectionEnd
p
oints
,
visibility:
toolbarVisible
,
visibility:
toolbarVisible
,
selectionDelegate:
selectionDelegate
,
selectionDelegate:
selectionDelegate
,
clipboardStatus:
clipboardStatus
,
clipboardStatus:
clipboardStatus
,
...
...
packages/flutter/test/widgets/text_selection_test.dart
View file @
baf86869
...
@@ -1041,7 +1041,7 @@ void main() {
...
@@ -1041,7 +1041,7 @@ void main() {
clipboardStatus:
FakeClipboardStatusNotifier
(),
clipboardStatus:
FakeClipboardStatusNotifier
(),
selectionDelegate:
FakeTextSelectionDelegate
(),
selectionDelegate:
FakeTextSelectionDelegate
(),
selectionControls:
selectionControls
,
selectionControls:
selectionControls
,
selectionEnd
P
oints:
const
<
TextSelectionPoint
>[],
selectionEnd
p
oints:
const
<
TextSelectionPoint
>[],
toolbarLayerLink:
toolbarLayerLink
,
toolbarLayerLink:
toolbarLayerLink
,
);
);
}
}
...
@@ -1055,7 +1055,7 @@ void main() {
...
@@ -1055,7 +1055,7 @@ void main() {
selectionOverlay
selectionOverlay
..
startHandleType
=
TextSelectionHandleType
.
left
..
startHandleType
=
TextSelectionHandleType
.
left
..
endHandleType
=
TextSelectionHandleType
.
right
..
endHandleType
=
TextSelectionHandleType
.
right
..
selectionEnd
P
oints
=
const
<
TextSelectionPoint
>[
..
selectionEnd
p
oints
=
const
<
TextSelectionPoint
>[
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
];
];
...
@@ -1100,7 +1100,7 @@ void main() {
...
@@ -1100,7 +1100,7 @@ void main() {
selectionOverlay
selectionOverlay
..
startHandleType
=
TextSelectionHandleType
.
collapsed
..
startHandleType
=
TextSelectionHandleType
.
collapsed
..
endHandleType
=
TextSelectionHandleType
.
collapsed
..
endHandleType
=
TextSelectionHandleType
.
collapsed
..
selectionEnd
P
oints
=
const
<
TextSelectionPoint
>[
..
selectionEnd
p
oints
=
const
<
TextSelectionPoint
>[
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
];
];
...
@@ -1122,7 +1122,7 @@ void main() {
...
@@ -1122,7 +1122,7 @@ void main() {
..
lineHeightAtStart
=
10.0
..
lineHeightAtStart
=
10.0
..
endHandleType
=
TextSelectionHandleType
.
right
..
endHandleType
=
TextSelectionHandleType
.
right
..
lineHeightAtEnd
=
11.0
..
lineHeightAtEnd
=
11.0
..
selectionEnd
P
oints
=
const
<
TextSelectionPoint
>[
..
selectionEnd
p
oints
=
const
<
TextSelectionPoint
>[
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
];
];
...
@@ -1159,7 +1159,7 @@ void main() {
...
@@ -1159,7 +1159,7 @@ void main() {
..
lineHeightAtStart
=
10.0
..
lineHeightAtStart
=
10.0
..
endHandleType
=
TextSelectionHandleType
.
right
..
endHandleType
=
TextSelectionHandleType
.
right
..
lineHeightAtEnd
=
11.0
..
lineHeightAtEnd
=
11.0
..
selectionEnd
P
oints
=
const
<
TextSelectionPoint
>[
..
selectionEnd
p
oints
=
const
<
TextSelectionPoint
>[
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
];
];
...
@@ -1206,7 +1206,7 @@ void main() {
...
@@ -1206,7 +1206,7 @@ void main() {
..
lineHeightAtStart
=
10.0
..
lineHeightAtStart
=
10.0
..
endHandleType
=
TextSelectionHandleType
.
right
..
endHandleType
=
TextSelectionHandleType
.
right
..
lineHeightAtEnd
=
11.0
..
lineHeightAtEnd
=
11.0
..
selectionEnd
P
oints
=
const
<
TextSelectionPoint
>[
..
selectionEnd
p
oints
=
const
<
TextSelectionPoint
>[
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
10
,
10
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
TextSelectionPoint
(
Offset
(
20
,
20
),
TextDirection
.
ltr
),
];
];
...
...
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