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
914556ea
Unverified
Commit
914556ea
authored
May 23, 2022
by
gaaclarke
Committed by
GitHub
May 23, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started sharing SemanticsProperties between the Widget and the RenderObject (#104281)
parent
7ece8f9f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
1115 deletions
+174
-1115
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+163
-980
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+3
-132
reattach_test.dart
packages/flutter/test/rendering/reattach_test.dart
+4
-1
simple_semantics_test.dart
packages/flutter/test/rendering/simple_semantics_test.dart
+4
-2
No files found.
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
914556ea
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/widgets/basic.dart
View file @
914556ea
...
...
@@ -6902,91 +6902,14 @@ class Semantics extends SingleChildRenderObjectWidget {
/// an [ExcludeSemantics] widget and then another [Semantics] widget.
final
bool
excludeSemantics
;
AttributedString
?
get
_effectiveAttributedLabel
{
return
properties
.
attributedLabel
??
(
properties
.
label
==
null
?
null
:
AttributedString
(
properties
.
label
!));
}
AttributedString
?
get
_effectiveAttributedValue
{
return
properties
.
attributedValue
??
(
properties
.
value
==
null
?
null
:
AttributedString
(
properties
.
value
!));
}
AttributedString
?
get
_effectiveAttributedIncreasedValue
{
return
properties
.
attributedIncreasedValue
??
(
properties
.
increasedValue
==
null
?
null
:
AttributedString
(
properties
.
increasedValue
!));
}
AttributedString
?
get
_effectiveAttributedDecreasedValue
{
return
properties
.
attributedDecreasedValue
??
(
properties
.
decreasedValue
==
null
?
null
:
AttributedString
(
properties
.
decreasedValue
!));
}
AttributedString
?
get
_effectiveAttributedHint
{
return
properties
.
attributedHint
??
(
properties
.
hint
==
null
?
null
:
AttributedString
(
properties
.
hint
!));
}
@override
RenderSemanticsAnnotations
createRenderObject
(
BuildContext
context
)
{
return
RenderSemanticsAnnotations
(
container:
container
,
explicitChildNodes:
explicitChildNodes
,
excludeSemantics:
excludeSemantics
,
enabled:
properties
.
enabled
,
checked:
properties
.
checked
,
toggled:
properties
.
toggled
,
selected:
properties
.
selected
,
button:
properties
.
button
,
slider:
properties
.
slider
,
keyboardKey:
properties
.
keyboardKey
,
link:
properties
.
link
,
header:
properties
.
header
,
textField:
properties
.
textField
,
readOnly:
properties
.
readOnly
,
focusable:
properties
.
focusable
,
focused:
properties
.
focused
,
liveRegion:
properties
.
liveRegion
,
maxValueLength:
properties
.
maxValueLength
,
currentValueLength:
properties
.
currentValueLength
,
inMutuallyExclusiveGroup:
properties
.
inMutuallyExclusiveGroup
,
obscured:
properties
.
obscured
,
multiline:
properties
.
multiline
,
scopesRoute:
properties
.
scopesRoute
,
namesRoute:
properties
.
namesRoute
,
hidden:
properties
.
hidden
,
image:
properties
.
image
,
attributedLabel:
_effectiveAttributedLabel
,
attributedValue:
_effectiveAttributedValue
,
attributedIncreasedValue:
_effectiveAttributedIncreasedValue
,
attributedDecreasedValue:
_effectiveAttributedDecreasedValue
,
attributedHint:
_effectiveAttributedHint
,
tooltip:
properties
.
tooltip
,
hintOverrides:
properties
.
hintOverrides
,
properties:
properties
,
textDirection:
_getTextDirection
(
context
),
sortKey:
properties
.
sortKey
,
tagForChildren:
properties
.
tagForChildren
,
onTap:
properties
.
onTap
,
onLongPress:
properties
.
onLongPress
,
onScrollLeft:
properties
.
onScrollLeft
,
onScrollRight:
properties
.
onScrollRight
,
onScrollUp:
properties
.
onScrollUp
,
onScrollDown:
properties
.
onScrollDown
,
onIncrease:
properties
.
onIncrease
,
onDecrease:
properties
.
onDecrease
,
onCopy:
properties
.
onCopy
,
onDismiss:
properties
.
onDismiss
,
onCut:
properties
.
onCut
,
onPaste:
properties
.
onPaste
,
onMoveCursorForwardByCharacter:
properties
.
onMoveCursorForwardByCharacter
,
onMoveCursorBackwardByCharacter:
properties
.
onMoveCursorBackwardByCharacter
,
onMoveCursorForwardByWord:
properties
.
onMoveCursorForwardByWord
,
onMoveCursorBackwardByWord:
properties
.
onMoveCursorBackwardByWord
,
onSetSelection:
properties
.
onSetSelection
,
onSetText:
properties
.
onSetText
,
onDidGainAccessibilityFocus:
properties
.
onDidGainAccessibilityFocus
,
onDidLoseAccessibilityFocus:
properties
.
onDidLoseAccessibilityFocus
,
customSemanticsActions:
properties
.
customSemanticsActions
,
);
}
...
...
@@ -7012,60 +6935,8 @@ class Semantics extends SingleChildRenderObjectWidget {
..
container
=
container
..
explicitChildNodes
=
explicitChildNodes
..
excludeSemantics
=
excludeSemantics
..
scopesRoute
=
properties
.
scopesRoute
..
enabled
=
properties
.
enabled
..
checked
=
properties
.
checked
..
toggled
=
properties
.
toggled
..
selected
=
properties
.
selected
..
button
=
properties
.
button
..
slider
=
properties
.
slider
..
keyboardKey
=
properties
.
keyboardKey
..
link
=
properties
.
link
..
header
=
properties
.
header
..
textField
=
properties
.
textField
..
readOnly
=
properties
.
readOnly
..
focusable
=
properties
.
focusable
..
focused
=
properties
.
focused
..
inMutuallyExclusiveGroup
=
properties
.
inMutuallyExclusiveGroup
..
obscured
=
properties
.
obscured
..
multiline
=
properties
.
multiline
..
hidden
=
properties
.
hidden
..
image
=
properties
.
image
..
liveRegion
=
properties
.
liveRegion
..
maxValueLength
=
properties
.
maxValueLength
..
currentValueLength
=
properties
.
currentValueLength
..
attributedLabel
=
_effectiveAttributedLabel
..
attributedValue
=
_effectiveAttributedValue
..
attributedIncreasedValue
=
_effectiveAttributedIncreasedValue
..
attributedDecreasedValue
=
_effectiveAttributedDecreasedValue
..
attributedHint
=
_effectiveAttributedHint
..
tooltip
=
properties
.
tooltip
..
hintOverrides
=
properties
.
hintOverrides
..
namesRoute
=
properties
.
namesRoute
..
textDirection
=
_getTextDirection
(
context
)
..
sortKey
=
properties
.
sortKey
..
tagForChildren
=
properties
.
tagForChildren
..
onTap
=
properties
.
onTap
..
onLongPress
=
properties
.
onLongPress
..
onScrollLeft
=
properties
.
onScrollLeft
..
onScrollRight
=
properties
.
onScrollRight
..
onScrollUp
=
properties
.
onScrollUp
..
onScrollDown
=
properties
.
onScrollDown
..
onIncrease
=
properties
.
onIncrease
..
onDismiss
=
properties
.
onDismiss
..
onDecrease
=
properties
.
onDecrease
..
onCopy
=
properties
.
onCopy
..
onCut
=
properties
.
onCut
..
onPaste
=
properties
.
onPaste
..
onMoveCursorForwardByCharacter
=
properties
.
onMoveCursorForwardByCharacter
..
onMoveCursorBackwardByCharacter
=
properties
.
onMoveCursorForwardByCharacter
..
onMoveCursorForwardByWord
=
properties
.
onMoveCursorForwardByWord
..
onMoveCursorBackwardByWord
=
properties
.
onMoveCursorBackwardByWord
..
onSetSelection
=
properties
.
onSetSelection
..
onSetText
=
properties
.
onSetText
..
onDidGainAccessibilityFocus
=
properties
.
onDidGainAccessibilityFocus
..
onDidLoseAccessibilityFocus
=
properties
.
onDidLoseAccessibilityFocus
..
customSemanticsActions
=
properties
.
customSemanticsActions
;
..
properties
=
properties
..
textDirection
=
_getTextDirection
(
context
);
}
@override
...
...
packages/flutter/test/rendering/reattach_test.dart
View file @
914556ea
...
...
@@ -28,7 +28,10 @@ class TestTree {
child:
RenderPositionedBox
(
child:
child
=
RenderConstrainedBox
(
additionalConstraints:
const
BoxConstraints
.
tightFor
(
height:
20.0
,
width:
20.0
),
child:
RenderSemanticsAnnotations
(
attributedLabel:
AttributedString
(
'Hello there foo'
),
textDirection:
TextDirection
.
ltr
),
child:
RenderSemanticsAnnotations
(
textDirection:
TextDirection
.
ltr
,
properties:
const
SemanticsProperties
(
label:
'Hello there foo'
),
),
),
),
),
...
...
packages/flutter/test/rendering/simple_semantics_test.dart
View file @
914556ea
...
...
@@ -13,7 +13,7 @@ void main() {
test
(
'only send semantics update if semantics have changed'
,
()
{
final
TestRender
testRender
=
TestRender
()
..
attributedLabel
=
AttributedString
(
'hello'
)
..
properties
=
const
SemanticsProperties
(
label:
'hello'
)
..
textDirection
=
TextDirection
.
ltr
;
final
RenderConstrainedBox
tree
=
RenderConstrainedBox
(
...
...
@@ -48,7 +48,7 @@ void main() {
semanticsUpdateCount
=
0
;
// Change semantics and request update.
testRender
.
attributedLabel
=
AttributedString
(
'bye'
);
testRender
.
properties
=
const
SemanticsProperties
(
label:
'bye'
);
testRender
.
markNeedsSemanticsUpdate
();
pumpFrame
(
phase:
EnginePhase
.
flushSemantics
);
...
...
@@ -61,6 +61,8 @@ void main() {
}
class
TestRender
extends
RenderSemanticsAnnotations
{
TestRender
()
:
super
(
properties:
const
SemanticsProperties
());
int
describeSemanticsConfigurationCallCount
=
0
;
@override
...
...
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