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
1daae0b0
Unverified
Commit
1daae0b0
authored
Oct 25, 2021
by
Gary Qian
Committed by
GitHub
Oct 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove assert that prevents WidgetSpans from being used in SelectableText (#92295)
parent
4d79bb02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
selectable_text.dart
packages/flutter/lib/src/material/selectable_text.dart
+5
-3
selectable_text_test.dart
packages/flutter/test/widgets/selectable_text_test.dart
+2
-2
No files found.
packages/flutter/lib/src/material/selectable_text.dart
View file @
1daae0b0
...
...
@@ -585,9 +585,11 @@ class _SelectableTextState extends State<SelectableText> with AutomaticKeepAlive
@override
Widget
build
(
BuildContext
context
)
{
super
.
build
(
context
);
// See AutomaticKeepAliveClientMixin.
assert
(()
{
return
_controller
.
_textSpan
.
visitChildren
((
InlineSpan
span
)
=>
span
.
runtimeType
==
TextSpan
);
}(),
'SelectableText only supports TextSpan; Other type of InlineSpan is not allowed'
);
// TODO(garyq): Assert to block WidgetSpans from being used here are removed,
// but we still do not yet have nice handling of things like carets, clipboard,
// and other features. We should add proper support. Currently, caret handling
// is blocked on SkParagraph switch and https://github.com/flutter/engine/pull/27010
// should be landed in SkParagraph after the switch is complete.
assert
(
debugCheckHasMediaQuery
(
context
));
assert
(
debugCheckHasDirectionality
(
context
));
assert
(
...
...
packages/flutter/test/widgets/selectable_text_test.dart
View file @
1daae0b0
...
...
@@ -319,7 +319,7 @@ void main() {
expect
(
selectableText
.
enableInteractiveSelection
,
true
);
});
testWidgets
(
'Rich selectable text
only support Tex
tSpan'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Rich selectable text
supports Widge
tSpan'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
const
MediaQuery
(
data:
MediaQueryData
(),
...
...
@@ -357,7 +357,7 @@ void main() {
),
),
);
expect
(
tester
.
takeException
(),
is
AssertionError
);
expect
(
tester
.
takeException
(),
is
Null
);
});
testWidgets
(
'no text keyboard when widget is focused'
,
(
WidgetTester
tester
)
async
{
...
...
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