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
74e51821
Unverified
Commit
74e51821
authored
Jan 23, 2021
by
Kate Lovett
Committed by
GitHub
Jan 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove span deprecations (#73747)
parent
5af0429f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
100 deletions
+9
-100
inline_span.dart
packages/flutter/lib/src/painting/inline_span.dart
+0
-53
placeholder_span.dart
packages/flutter/lib/src/painting/placeholder_span.dart
+0
-13
text_span.dart
packages/flutter/lib/src/painting/text_span.dart
+9
-34
No files found.
packages/flutter/lib/src/painting/inline_span.dart
View file @
74e51821
...
...
@@ -156,32 +156,6 @@ abstract class InlineSpan extends DiagnosticableTree {
/// of [TextSpan].
final
TextStyle
?
style
;
// TODO(garyq): Remove the deprecated visitTextSpan, text, and children.
/// Returns the text associated with this span if this is an instance of [TextSpan],
/// otherwise returns null.
@Deprecated
(
'InlineSpan does not innately have text. Use TextSpan.text instead. '
'This feature was deprecated after v1.7.3.'
)
String
?
get
text
=>
null
;
// TODO(garyq): Remove the deprecated visitTextSpan, text, and children.
/// Returns the [InlineSpan] children list associated with this span if this is an
/// instance of [TextSpan], otherwise returns null.
@Deprecated
(
'InlineSpan does not innately have children. Use TextSpan.children instead. '
'This feature was deprecated after v1.7.3.'
)
List
<
InlineSpan
>?
get
children
=>
null
;
/// Returns the [GestureRecognizer] associated with this span if this is an
/// instance of [TextSpan], otherwise returns null.
@Deprecated
(
'InlineSpan does not innately have a recognizer. Use TextSpan.recognizer instead. '
'This feature was deprecated after v1.7.3.'
)
GestureRecognizer
?
get
recognizer
=>
null
;
/// Apply the properties of this object to the given [ParagraphBuilder], from
/// which a [Paragraph] can be obtained.
///
...
...
@@ -196,18 +170,6 @@ abstract class InlineSpan extends DiagnosticableTree {
/// [Paragraph] objects can be drawn on [Canvas] objects.
void
build
(
ui
.
ParagraphBuilder
builder
,
{
double
textScaleFactor
=
1.0
,
List
<
PlaceholderDimensions
>?
dimensions
});
// TODO(garyq): Remove the deprecated visitTextSpan, text, and children.
/// Walks this [TextSpan] and any descendants in pre-order and calls `visitor`
/// for each span that has content.
///
/// When `visitor` returns true, the walk will continue. When `visitor` returns
/// false, then the walk will end.
@Deprecated
(
'Use visitChildren instead. '
'This feature was deprecated after v1.7.3.'
)
bool
visitTextSpan
(
bool
visitor
(
TextSpan
span
));
/// Walks this [InlineSpan] and any descendants in pre-order and calls `visitor`
/// for each span that has content.
///
...
...
@@ -319,21 +281,6 @@ abstract class InlineSpan extends DiagnosticableTree {
@protected
int
?
codeUnitAtVisitor
(
int
index
,
Accumulator
offset
);
/// Populates the `semanticsOffsets` and `semanticsElements` with the appropriate data
/// to be able to construct a [SemanticsNode].
///
/// If applicable, the beginning and end text offset are added to [semanticsOffsets].
/// [PlaceholderSpan]s have a text length of 1, which corresponds to the object
/// replacement character (0xFFFC) that is inserted to represent it.
///
/// Any [GestureRecognizer]s are added to `semanticsElements`. Null is added to
/// `semanticsElements` for [PlaceholderSpan]s.
@Deprecated
(
'Implement computeSemanticsInformation instead. '
'This feature was deprecated after v1.7.3.'
)
void
describeSemantics
(
Accumulator
offset
,
List
<
int
>
semanticsOffsets
,
List
<
dynamic
>
semanticsElements
);
/// In checked mode, throws an exception if the object is not in a
/// valid configuration. Otherwise, returns true.
///
...
...
packages/flutter/lib/src/painting/placeholder_span.dart
View file @
74e51821
...
...
@@ -66,18 +66,6 @@ abstract class PlaceholderSpan extends InlineSpan {
collector
.
add
(
InlineSpanSemanticsInformation
.
placeholder
);
}
// TODO(garyq): Remove this after next stable release.
/// The [visitTextSpan] method is invalid on [PlaceholderSpan]s.
@override
@Deprecated
(
'Use to visitChildren instead. '
'This feature was deprecated after v1.7.3.'
)
bool
visitTextSpan
(
bool
visitor
(
TextSpan
span
))
{
assert
(
false
,
'visitTextSpan is deprecated. Use visitChildren to support InlineSpans'
);
return
false
;
}
/// Populates the `semanticsOffsets` and `semanticsElements` with the appropriate data
/// to be able to construct a [SemanticsNode].
///
...
...
@@ -85,7 +73,6 @@ abstract class PlaceholderSpan extends InlineSpan {
/// replacement character (0xFFFC) that is inserted to represent it.
///
/// Null is added to `semanticsElements` for [PlaceholderSpan]s.
@override
void
describeSemantics
(
Accumulator
offset
,
List
<
int
>
semanticsOffsets
,
List
<
dynamic
>
semanticsElements
)
{
semanticsOffsets
.
add
(
offset
.
value
);
semanticsOffsets
.
add
(
offset
.
value
+
1
);
...
...
packages/flutter/lib/src/painting/text_span.dart
View file @
74e51821
...
...
@@ -79,7 +79,6 @@ class TextSpan extends InlineSpan {
/// children.
///
/// This getter does not include the contents of its children.
@override
final
String
?
text
;
...
...
@@ -92,7 +91,6 @@ class TextSpan extends InlineSpan {
/// and may have unexpected results.
///
/// The list must not contain any nulls.
@override
final
List
<
InlineSpan
>?
children
;
/// A gesture recognizer that will receive events that hit this span.
...
...
@@ -170,7 +168,6 @@ class TextSpan extends InlineSpan {
/// }
/// ```
/// {@end-tool}
@override
final
GestureRecognizer
?
recognizer
;
/// An alternative semantics label for this [TextSpan].
...
...
@@ -239,36 +236,6 @@ class TextSpan extends InlineSpan {
return
true
;
}
// TODO(garyq): Remove this after next stable release.
/// Walks this [TextSpan] and any descendants in pre-order and calls `visitor`
/// for each span that has content.
///
/// When `visitor` returns true, the walk will continue. When `visitor`
/// returns false, then the walk will end.
@override
@Deprecated
(
'Use to visitChildren instead. '
'This feature was deprecated after v1.7.3.'
)
bool
visitTextSpan
(
bool
visitor
(
TextSpan
span
))
{
if
(
text
!=
null
)
{
if
(!
visitor
(
this
))
return
false
;
}
if
(
children
!=
null
)
{
for
(
final
InlineSpan
child
in
children
!)
{
assert
(
child
is
TextSpan
,
'visitTextSpan is deprecated. Use visitChildren to support InlineSpans'
,
);
final
TextSpan
textSpanChild
=
child
as
TextSpan
;
if
(!
textSpanChild
.
visitTextSpan
(
visitor
))
return
false
;
}
}
return
true
;
}
/// Returns the text span that contains the given position in the text.
@override
InlineSpan
?
getSpanForPositionVisitor
(
TextPosition
position
,
Accumulator
offset
)
{
...
...
@@ -338,7 +305,15 @@ class TextSpan extends InlineSpan {
return
null
;
}
@override
/// Populates the `semanticsOffsets` and `semanticsElements` with the appropriate data
/// to be able to construct a [SemanticsNode].
///
/// If applicable, the beginning and end text offset are added to [semanticsOffsets].
/// [PlaceholderSpan]s have a text length of 1, which corresponds to the object
/// replacement character (0xFFFC) that is inserted to represent it.
///
/// Any [GestureRecognizer]s are added to `semanticsElements`. Null is added to
/// `semanticsElements` for [PlaceholderSpan]s.
void
describeSemantics
(
Accumulator
offset
,
List
<
int
>
semanticsOffsets
,
List
<
dynamic
>
semanticsElements
)
{
if
(
recognizer
!=
null
&&
...
...
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