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
c8c20fbc
Unverified
Commit
c8c20fbc
authored
Jun 19, 2019
by
chunhtai
Committed by
GitHub
Jun 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add read only semantics flag (#34683)
parent
0d9a1b20
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
1 deletion
+45
-1
engine.version
bin/internal/engine.version
+1
-1
custom_paint.dart
packages/flutter/lib/src/rendering/custom_paint.dart
+3
-0
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+14
-0
semantics.dart
packages/flutter/lib/src/semantics/semantics.dart
+16
-0
basic.dart
packages/flutter/lib/src/widgets/basic.dart
+4
-0
custom_painter_test.dart
packages/flutter/test/widgets/custom_painter_test.dart
+2
-0
semantics_test.dart
packages/flutter/test/widgets/semantics_test.dart
+1
-0
matchers.dart
packages/flutter_test/lib/src/matchers.dart
+3
-0
matchers_test.dart
packages/flutter_test/test/matchers_test.dart
+1
-0
No files found.
bin/internal/engine.version
View file @
c8c20fbc
20d3861ac8e1f8f38c8659b16b699d0e63db01b1
54f88ab5da4d0f3cff5337ab263dbf3385ee78df
packages/flutter/lib/src/rendering/custom_paint.dart
View file @
c8c20fbc
...
...
@@ -832,6 +832,9 @@ class RenderCustomPaint extends RenderProxyBox {
if
(
properties
.
textField
!=
null
)
{
config
.
isTextField
=
properties
.
textField
;
}
if
(
properties
.
readOnly
!=
null
)
{
config
.
isReadOnly
=
properties
.
readOnly
;
}
if
(
properties
.
focused
!=
null
)
{
config
.
isFocused
=
properties
.
focused
;
}
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
c8c20fbc
...
...
@@ -3426,6 +3426,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool
button
,
bool
header
,
bool
textField
,
bool
readOnly
,
bool
focused
,
bool
inMutuallyExclusiveGroup
,
bool
obscured
,
...
...
@@ -3473,6 +3474,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
_button
=
button
,
_header
=
header
,
_textField
=
textField
,
_readOnly
=
readOnly
,
_focused
=
focused
,
_inMutuallyExclusiveGroup
=
inMutuallyExclusiveGroup
,
_obscured
=
obscured
,
...
...
@@ -3629,6 +3631,16 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
markNeedsSemanticsUpdate
();
}
/// If non-null, sets the [SemanticsNode.isReadOnly] semantic to the given value.
bool
get
readOnly
=>
_readOnly
;
bool
_readOnly
;
set
readOnly
(
bool
value
)
{
if
(
readOnly
==
value
)
return
;
_readOnly
=
value
;
markNeedsSemanticsUpdate
();
}
/// If non-null, sets the [SemanticsNode.isFocused] semantic to the given value.
bool
get
focused
=>
_focused
;
bool
_focused
;
...
...
@@ -4252,6 +4264,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
config
.
isHeader
=
header
;
if
(
textField
!=
null
)
config
.
isTextField
=
textField
;
if
(
readOnly
!=
null
)
config
.
isReadOnly
=
readOnly
;
if
(
focused
!=
null
)
config
.
isFocused
=
focused
;
if
(
inMutuallyExclusiveGroup
!=
null
)
...
...
packages/flutter/lib/src/semantics/semantics.dart
View file @
c8c20fbc
...
...
@@ -565,6 +565,7 @@ class SemanticsProperties extends DiagnosticableTree {
this
.
button
,
this
.
header
,
this
.
textField
,
this
.
readOnly
,
this
.
focused
,
this
.
inMutuallyExclusiveGroup
,
this
.
hidden
,
...
...
@@ -651,6 +652,13 @@ class SemanticsProperties extends DiagnosticableTree {
/// text field.
final
bool
textField
;
/// If non-null, indicates that this subtree is read only.
///
/// Only applicable when [textField] is true
///
/// TalkBack/VoiceOver will treat it as non-editable text field.
final
bool
readOnly
;
/// If non-null, whether the node currently holds input focus.
///
/// At most one node in the tree should hold input focus at any point in time.
...
...
@@ -3506,6 +3514,14 @@ class SemanticsConfiguration {
_setFlag
(
SemanticsFlag
.
isTextField
,
value
);
}
/// Whether the owning [RenderObject] is read only.
///
/// Only applicable when [isTextField] is true.
bool
get
isReadOnly
=>
_hasFlag
(
SemanticsFlag
.
isReadOnly
);
set
isReadOnly
(
bool
value
)
{
_setFlag
(
SemanticsFlag
.
isReadOnly
,
value
);
}
/// Whether the [value] should be obscured.
///
/// This option is usually set in combination with [textField] to indicate
...
...
packages/flutter/lib/src/widgets/basic.dart
View file @
c8c20fbc
...
...
@@ -5919,6 +5919,7 @@ class Semantics extends SingleChildRenderObjectWidget {
bool
button
,
bool
header
,
bool
textField
,
bool
readOnly
,
bool
focused
,
bool
inMutuallyExclusiveGroup
,
bool
obscured
,
...
...
@@ -5968,6 +5969,7 @@ class Semantics extends SingleChildRenderObjectWidget {
button:
button
,
header:
header
,
textField:
textField
,
readOnly:
readOnly
,
focused:
focused
,
inMutuallyExclusiveGroup:
inMutuallyExclusiveGroup
,
obscured:
obscured
,
...
...
@@ -6076,6 +6078,7 @@ class Semantics extends SingleChildRenderObjectWidget {
button:
properties
.
button
,
header:
properties
.
header
,
textField:
properties
.
textField
,
readOnly:
properties
.
readOnly
,
focused:
properties
.
focused
,
liveRegion:
properties
.
liveRegion
,
inMutuallyExclusiveGroup:
properties
.
inMutuallyExclusiveGroup
,
...
...
@@ -6141,6 +6144,7 @@ class Semantics extends SingleChildRenderObjectWidget {
..
button
=
properties
.
button
..
header
=
properties
.
header
..
textField
=
properties
.
textField
..
readOnly
=
properties
.
readOnly
..
focused
=
properties
.
focused
..
inMutuallyExclusiveGroup
=
properties
.
inMutuallyExclusiveGroup
..
obscured
=
properties
.
obscured
...
...
packages/flutter/test/widgets/custom_painter_test.dart
View file @
c8c20fbc
...
...
@@ -412,6 +412,7 @@ void _defineTests() {
hidden:
true
,
button:
true
,
textField:
true
,
readOnly:
true
,
focused:
true
,
inMutuallyExclusiveGroup:
true
,
header:
true
,
...
...
@@ -458,6 +459,7 @@ void _defineTests() {
hidden:
true
,
button:
true
,
textField:
true
,
readOnly:
true
,
focused:
true
,
inMutuallyExclusiveGroup:
true
,
header:
true
,
...
...
packages/flutter/test/widgets/semantics_test.dart
View file @
c8c20fbc
...
...
@@ -474,6 +474,7 @@ void main() {
selected:
true
,
button:
true
,
textField:
true
,
readOnly:
true
,
focused:
true
,
inMutuallyExclusiveGroup:
true
,
header:
true
,
...
...
packages/flutter_test/lib/src/matchers.dart
View file @
c8c20fbc
...
...
@@ -413,6 +413,7 @@ Matcher matchesSemantics({
bool
isButton
=
false
,
bool
isFocused
=
false
,
bool
isTextField
=
false
,
bool
isReadOnly
=
false
,
bool
hasEnabledState
=
false
,
bool
isEnabled
=
false
,
bool
isInMutuallyExclusiveGroup
=
false
,
...
...
@@ -464,6 +465,8 @@ Matcher matchesSemantics({
flags
.
add
(
SemanticsFlag
.
isButton
);
if
(
isTextField
)
flags
.
add
(
SemanticsFlag
.
isTextField
);
if
(
isReadOnly
)
flags
.
add
(
SemanticsFlag
.
isReadOnly
);
if
(
isFocused
)
flags
.
add
(
SemanticsFlag
.
isFocused
);
if
(
hasEnabledState
)
...
...
packages/flutter_test/test/matchers_test.dart
View file @
c8c20fbc
...
...
@@ -597,6 +597,7 @@ void main() {
isSelected:
true
,
isButton:
true
,
isTextField:
true
,
isReadOnly:
true
,
hasEnabledState:
true
,
isFocused:
true
,
isEnabled:
true
,
...
...
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