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
2d9a075d
Unverified
Commit
2d9a075d
authored
Nov 06, 2023
by
Kostia Sokolovskyi
Committed by
GitHub
Nov 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover text_selection tests with leak tracking. (#137009)
parent
db57d286
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
58 deletions
+141
-58
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+12
-1
text_selection_test.dart
packages/flutter/test/widgets/text_selection_test.dart
+127
-56
text_selection_toolbar_layout_delegate_test.dart
.../widgets/text_selection_toolbar_layout_delegate_test.dart
+2
-1
No files found.
packages/flutter/lib/src/rendering/editable.dart
View file @
2d9a075d
...
@@ -364,7 +364,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -364,7 +364,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
_readOnly
=
readOnly
,
_readOnly
=
readOnly
,
_forceLine
=
forceLine
,
_forceLine
=
forceLine
,
_clipBehavior
=
clipBehavior
,
_clipBehavior
=
clipBehavior
,
_hasFocus
=
hasFocus
??
false
{
_hasFocus
=
hasFocus
??
false
,
_disposeShowCursor
=
showCursor
==
null
{
assert
(!
_showCursor
.
value
||
cursorColor
!=
null
);
assert
(!
_showCursor
.
value
||
cursorColor
!=
null
);
_selectionPainter
.
highlightColor
=
selectionColor
;
_selectionPainter
.
highlightColor
=
selectionColor
;
...
@@ -405,6 +406,10 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -405,6 +406,10 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
_selectionPainter
.
dispose
();
_selectionPainter
.
dispose
();
_caretPainter
.
dispose
();
_caretPainter
.
dispose
();
_textPainter
.
dispose
();
_textPainter
.
dispose
();
if
(
_disposeShowCursor
)
{
_showCursor
.
dispose
();
_disposeShowCursor
=
false
;
}
super
.
dispose
();
super
.
dispose
();
}
}
...
@@ -879,6 +884,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -879,6 +884,8 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
_caretPainter
.
backgroundCursorColor
=
value
;
_caretPainter
.
backgroundCursorColor
=
value
;
}
}
bool
_disposeShowCursor
;
/// Whether to paint the cursor.
/// Whether to paint the cursor.
ValueNotifier
<
bool
>
get
showCursor
=>
_showCursor
;
ValueNotifier
<
bool
>
get
showCursor
=>
_showCursor
;
ValueNotifier
<
bool
>
_showCursor
;
ValueNotifier
<
bool
>
_showCursor
;
...
@@ -889,6 +896,10 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
...
@@ -889,6 +896,10 @@ class RenderEditable extends RenderBox with RelayoutWhenSystemFontsChangeMixin,
if
(
attached
)
{
if
(
attached
)
{
_showCursor
.
removeListener
(
_showHideCursor
);
_showCursor
.
removeListener
(
_showHideCursor
);
}
}
if
(
_disposeShowCursor
)
{
_showCursor
.
dispose
();
_disposeShowCursor
=
false
;
}
_showCursor
=
value
;
_showCursor
=
value
;
if
(
attached
)
{
if
(
attached
)
{
_showHideCursor
();
_showHideCursor
();
...
...
packages/flutter/test/widgets/text_selection_test.dart
View file @
2d9a075d
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/text_selection_toolbar_layout_delegate_test.dart
View file @
2d9a075d
...
@@ -4,9 +4,10 @@
...
@@ -4,9 +4,10 @@
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'positions itself at anchorAbove if it fits'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'positions itself at anchorAbove if it fits'
,
(
WidgetTester
tester
)
async
{
late
StateSetter
setState
;
late
StateSetter
setState
;
const
double
height
=
43.0
;
const
double
height
=
43.0
;
const
double
anchorBelowY
=
500.0
;
const
double
anchorBelowY
=
500.0
;
...
...
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