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
24e3f705
Unverified
Commit
24e3f705
authored
Jan 09, 2018
by
Michael Goderbauer
Committed by
GitHub
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename SemanticsFlags to SemanticsFlag (#13994)
to align with `SemanticsAction` and other enum-like types.
parent
4d37e03e
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
142 additions
and
142 deletions
+142
-142
engine.version
bin/internal/engine.version
+1
-1
semantics.dart
packages/flutter/lib/src/semantics/semantics.dart
+29
-29
semantics_debugger.dart
packages/flutter/lib/src/widgets/semantics_debugger.dart
+3
-3
button_test.dart
packages/flutter/test/cupertino/button_test.dart
+2
-2
buttons_test.dart
packages/flutter/test/material/buttons_test.dart
+3
-3
card_test.dart
packages/flutter/test/material/card_test.dart
+2
-2
control_list_tile_test.dart
packages/flutter/test/material/control_list_tile_test.dart
+15
-15
date_picker_test.dart
packages/flutter/test/material/date_picker_test.dart
+6
-6
icon_button_test.dart
packages/flutter/test/material/icon_button_test.dart
+1
-1
list_tile_test.dart
packages/flutter/test/material/list_tile_test.dart
+10
-10
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+3
-3
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+2
-2
user_accounts_drawer_header_test.dart
...utter/test/material/user_accounts_drawer_header_test.dart
+3
-3
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+5
-5
implicit_semantics_test.dart
packages/flutter/test/widgets/implicit_semantics_test.dart
+4
-4
semantics_1_test.dart
packages/flutter/test/widgets/semantics_1_test.dart
+8
-8
semantics_2_test.dart
packages/flutter/test/widgets/semantics_2_test.dart
+6
-6
semantics_3_test.dart
packages/flutter/test/widgets/semantics_3_test.dart
+4
-4
semantics_4_test.dart
packages/flutter/test/widgets/semantics_4_test.dart
+5
-5
semantics_7_test.dart
packages/flutter/test/widgets/semantics_7_test.dart
+5
-5
semantics_8_test.dart
packages/flutter/test/widgets/semantics_8_test.dart
+3
-3
semantics_tester.dart
packages/flutter/test/widgets/semantics_tester.dart
+20
-20
semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart
...eTestSemanticsExpressionForCurrentSemanticsTree_test.dart
+2
-2
No files found.
bin/internal/engine.version
View file @
24e3f705
6a724f0d3e22d41246baf3447d7ba2c9ff88676
5
16e365e7224f3d295f065e85df11060f011a74c
5
packages/flutter/lib/src/semantics/semantics.dart
View file @
24e3f705
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
'dart:typed_data'
;
import
'dart:typed_data'
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
as
ui
;
import
'dart:ui'
show
Offset
,
Rect
,
SemanticsAction
,
SemanticsFlag
s
,
import
'dart:ui'
show
Offset
,
Rect
,
SemanticsAction
,
SemanticsFlag
,
TextDirection
;
TextDirection
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
...
@@ -106,7 +106,7 @@ class SemanticsData extends Diagnosticable {
...
@@ -106,7 +106,7 @@ class SemanticsData extends Diagnosticable {
assert
(
increasedValue
==
''
||
textDirection
!=
null
,
'A SemanticsData object with increasedValue "
$increasedValue
" had a null textDirection.'
),
assert
(
increasedValue
==
''
||
textDirection
!=
null
,
'A SemanticsData object with increasedValue "
$increasedValue
" had a null textDirection.'
),
assert
(
rect
!=
null
);
assert
(
rect
!=
null
);
/// A bit field of [SemanticsFlag
s]
that apply to this node.
/// A bit field of [SemanticsFlag
]s
that apply to this node.
final
int
flags
;
final
int
flags
;
/// A bit field of [SemanticsAction]s that apply to this node.
/// A bit field of [SemanticsAction]s that apply to this node.
...
@@ -157,7 +157,7 @@ class SemanticsData extends Diagnosticable {
...
@@ -157,7 +157,7 @@ class SemanticsData extends Diagnosticable {
final
Matrix4
transform
;
final
Matrix4
transform
;
/// Whether [flags] contains the given flag.
/// Whether [flags] contains the given flag.
bool
hasFlag
(
SemanticsFlag
s
flag
)
=>
(
flags
&
flag
.
index
)
!=
0
;
bool
hasFlag
(
SemanticsFlag
flag
)
=>
(
flags
&
flag
.
index
)
!=
0
;
/// Whether [actions] contains the given action.
/// Whether [actions] contains the given action.
bool
hasAction
(
SemanticsAction
action
)
=>
(
actions
&
action
.
index
)
!=
0
;
bool
hasAction
(
SemanticsAction
action
)
=>
(
actions
&
action
.
index
)
!=
0
;
...
@@ -178,7 +178,7 @@ class SemanticsData extends Diagnosticable {
...
@@ -178,7 +178,7 @@ class SemanticsData extends Diagnosticable {
properties
.
add
(
new
IterableProperty
<
String
>(
'actions'
,
actionSummary
,
ifEmpty:
null
));
properties
.
add
(
new
IterableProperty
<
String
>(
'actions'
,
actionSummary
,
ifEmpty:
null
));
final
List
<
String
>
flagSummary
=
<
String
>[];
final
List
<
String
>
flagSummary
=
<
String
>[];
for
(
SemanticsFlag
s
flag
in
SemanticsFlags
.
values
.
values
)
{
for
(
SemanticsFlag
flag
in
SemanticsFlag
.
values
.
values
)
{
if
((
flags
&
flag
.
index
)
!=
0
)
if
((
flags
&
flag
.
index
)
!=
0
)
flagSummary
.
add
(
describeEnum
(
flag
));
flagSummary
.
add
(
describeEnum
(
flag
));
}
}
...
@@ -856,7 +856,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
...
@@ -856,7 +856,7 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
int
_flags
=
_kEmptyConfig
.
_flags
;
int
_flags
=
_kEmptyConfig
.
_flags
;
bool
_hasFlag
(
SemanticsFlag
s
flag
)
=>
_flags
&
flag
.
index
!=
0
;
bool
_hasFlag
(
SemanticsFlag
flag
)
=>
_flags
&
flag
.
index
!=
0
;
/// A textual description of this node.
/// A textual description of this node.
///
///
...
@@ -1089,14 +1089,14 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
...
@@ -1089,14 +1089,14 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
}
}
final
List
<
String
>
actions
=
_actions
.
keys
.
map
((
SemanticsAction
action
)
=>
describeEnum
(
action
)).
toList
()..
sort
();
final
List
<
String
>
actions
=
_actions
.
keys
.
map
((
SemanticsAction
action
)
=>
describeEnum
(
action
)).
toList
()..
sort
();
properties
.
add
(
new
IterableProperty
<
String
>(
'actions'
,
actions
,
ifEmpty:
null
));
properties
.
add
(
new
IterableProperty
<
String
>(
'actions'
,
actions
,
ifEmpty:
null
));
if
(
_hasFlag
(
SemanticsFlag
s
.
hasEnabledState
))
if
(
_hasFlag
(
SemanticsFlag
.
hasEnabledState
))
properties
.
add
(
new
FlagProperty
(
'isEnabled'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isEnabled
),
ifFalse:
'disabled'
));
properties
.
add
(
new
FlagProperty
(
'isEnabled'
,
value:
_hasFlag
(
SemanticsFlag
.
isEnabled
),
ifFalse:
'disabled'
));
if
(
_hasFlag
(
SemanticsFlag
s
.
hasCheckedState
))
if
(
_hasFlag
(
SemanticsFlag
.
hasCheckedState
))
properties
.
add
(
new
FlagProperty
(
'isChecked'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isChecked
),
ifTrue:
'checked'
,
ifFalse:
'unchecked'
));
properties
.
add
(
new
FlagProperty
(
'isChecked'
,
value:
_hasFlag
(
SemanticsFlag
.
isChecked
),
ifTrue:
'checked'
,
ifFalse:
'unchecked'
));
properties
.
add
(
new
FlagProperty
(
'isSelected'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isSelected
),
ifTrue:
'selected'
));
properties
.
add
(
new
FlagProperty
(
'isSelected'
,
value:
_hasFlag
(
SemanticsFlag
.
isSelected
),
ifTrue:
'selected'
));
properties
.
add
(
new
FlagProperty
(
'isFocused'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isFocused
),
ifTrue:
'focused'
));
properties
.
add
(
new
FlagProperty
(
'isFocused'
,
value:
_hasFlag
(
SemanticsFlag
.
isFocused
),
ifTrue:
'focused'
));
properties
.
add
(
new
FlagProperty
(
'isButton'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isButton
),
ifTrue:
'button'
));
properties
.
add
(
new
FlagProperty
(
'isButton'
,
value:
_hasFlag
(
SemanticsFlag
.
isButton
),
ifTrue:
'button'
));
properties
.
add
(
new
FlagProperty
(
'isTextField'
,
value:
_hasFlag
(
SemanticsFlag
s
.
isTextField
),
ifTrue:
'textField'
));
properties
.
add
(
new
FlagProperty
(
'isTextField'
,
value:
_hasFlag
(
SemanticsFlag
.
isTextField
),
ifTrue:
'textField'
));
properties
.
add
(
new
StringProperty
(
'label'
,
_label
,
defaultValue:
''
));
properties
.
add
(
new
StringProperty
(
'label'
,
_label
,
defaultValue:
''
));
properties
.
add
(
new
StringProperty
(
'value'
,
_value
,
defaultValue:
''
));
properties
.
add
(
new
StringProperty
(
'value'
,
_value
,
defaultValue:
''
));
properties
.
add
(
new
StringProperty
(
'increasedValue'
,
_increasedValue
,
defaultValue:
''
));
properties
.
add
(
new
StringProperty
(
'increasedValue'
,
_increasedValue
,
defaultValue:
''
));
...
@@ -1747,9 +1747,9 @@ class SemanticsConfiguration {
...
@@ -1747,9 +1747,9 @@ class SemanticsConfiguration {
}
}
/// Whether the owning [RenderObject] is selected (true) or not (false).
/// Whether the owning [RenderObject] is selected (true) or not (false).
bool
get
isSelected
=>
_hasFlag
(
SemanticsFlag
s
.
isSelected
);
bool
get
isSelected
=>
_hasFlag
(
SemanticsFlag
.
isSelected
);
set
isSelected
(
bool
value
)
{
set
isSelected
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
isSelected
,
value
);
_setFlag
(
SemanticsFlag
.
isSelected
,
value
);
}
}
/// Whether the owning [RenderObject] is currently enabled.
/// Whether the owning [RenderObject] is currently enabled.
...
@@ -1763,10 +1763,10 @@ class SemanticsConfiguration {
...
@@ -1763,10 +1763,10 @@ class SemanticsConfiguration {
///
///
/// The getter will return null if the owning [RenderObject] doesn't support
/// The getter will return null if the owning [RenderObject] doesn't support
/// the concept of being enabled/disabled.
/// the concept of being enabled/disabled.
bool
get
isEnabled
=>
_hasFlag
(
SemanticsFlag
s
.
hasEnabledState
)
?
_hasFlag
(
SemanticsFlags
.
isEnabled
)
:
null
;
bool
get
isEnabled
=>
_hasFlag
(
SemanticsFlag
.
hasEnabledState
)
?
_hasFlag
(
SemanticsFlag
.
isEnabled
)
:
null
;
set
isEnabled
(
bool
value
)
{
set
isEnabled
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
hasEnabledState
,
true
);
_setFlag
(
SemanticsFlag
.
hasEnabledState
,
true
);
_setFlag
(
SemanticsFlag
s
.
isEnabled
,
value
);
_setFlag
(
SemanticsFlag
.
isEnabled
,
value
);
}
}
/// If this node has Boolean state that can be controlled by the user, whether
/// If this node has Boolean state that can be controlled by the user, whether
...
@@ -1777,28 +1777,28 @@ class SemanticsConfiguration {
...
@@ -1777,28 +1777,28 @@ class SemanticsConfiguration {
///
///
/// The getter returns null if the owning [RenderObject] does not have
/// The getter returns null if the owning [RenderObject] does not have
/// checked/unchecked state.
/// checked/unchecked state.
bool
get
isChecked
=>
_hasFlag
(
SemanticsFlag
s
.
hasCheckedState
)
?
_hasFlag
(
SemanticsFlags
.
isChecked
)
:
null
;
bool
get
isChecked
=>
_hasFlag
(
SemanticsFlag
.
hasCheckedState
)
?
_hasFlag
(
SemanticsFlag
.
isChecked
)
:
null
;
set
isChecked
(
bool
value
)
{
set
isChecked
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
hasCheckedState
,
true
);
_setFlag
(
SemanticsFlag
.
hasCheckedState
,
true
);
_setFlag
(
SemanticsFlag
s
.
isChecked
,
value
);
_setFlag
(
SemanticsFlag
.
isChecked
,
value
);
}
}
/// Whether the owning [RenderObject] currently holds the user's focus.
/// Whether the owning [RenderObject] currently holds the user's focus.
bool
get
isFocused
=>
_hasFlag
(
SemanticsFlag
s
.
isFocused
);
bool
get
isFocused
=>
_hasFlag
(
SemanticsFlag
.
isFocused
);
set
isFocused
(
bool
value
)
{
set
isFocused
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
isFocused
,
value
);
_setFlag
(
SemanticsFlag
.
isFocused
,
value
);
}
}
/// Whether the owning [RenderObject] is a button (true) or not (false).
/// Whether the owning [RenderObject] is a button (true) or not (false).
bool
get
isButton
=>
_hasFlag
(
SemanticsFlag
s
.
isButton
);
bool
get
isButton
=>
_hasFlag
(
SemanticsFlag
.
isButton
);
set
isButton
(
bool
value
)
{
set
isButton
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
isButton
,
value
);
_setFlag
(
SemanticsFlag
.
isButton
,
value
);
}
}
/// Whether the owning [RenderObject] is a text field.
/// Whether the owning [RenderObject] is a text field.
bool
get
isTextField
=>
_hasFlag
(
SemanticsFlag
s
.
isTextField
);
bool
get
isTextField
=>
_hasFlag
(
SemanticsFlag
.
isTextField
);
set
isTextField
(
bool
value
)
{
set
isTextField
(
bool
value
)
{
_setFlag
(
SemanticsFlag
s
.
isTextField
,
value
);
_setFlag
(
SemanticsFlag
.
isTextField
,
value
);
}
}
// TAGS
// TAGS
...
@@ -1836,7 +1836,7 @@ class SemanticsConfiguration {
...
@@ -1836,7 +1836,7 @@ class SemanticsConfiguration {
// INTERNAL FLAG MANAGEMENT
// INTERNAL FLAG MANAGEMENT
int
_flags
=
0
;
int
_flags
=
0
;
void
_setFlag
(
SemanticsFlag
s
flag
,
bool
value
)
{
void
_setFlag
(
SemanticsFlag
flag
,
bool
value
)
{
if
(
value
)
{
if
(
value
)
{
_flags
|=
flag
.
index
;
_flags
|=
flag
.
index
;
}
else
{
}
else
{
...
@@ -1845,7 +1845,7 @@ class SemanticsConfiguration {
...
@@ -1845,7 +1845,7 @@ class SemanticsConfiguration {
_hasBeenAnnotated
=
true
;
_hasBeenAnnotated
=
true
;
}
}
bool
_hasFlag
(
SemanticsFlag
s
flag
)
=>
(
_flags
&
flag
.
index
)
!=
0
;
bool
_hasFlag
(
SemanticsFlag
flag
)
=>
(
_flags
&
flag
.
index
)
!=
0
;
// CONFIGURATION COMBINATION LOGIC
// CONFIGURATION COMBINATION LOGIC
...
...
packages/flutter/lib/src/widgets/semantics_debugger.dart
View file @
24e3f705
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:math'
as
math
;
import
'dart:math'
as
math
;
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'dart:ui'
as
ui
show
window
;
import
'dart:ui'
as
ui
show
window
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
...
@@ -200,8 +200,8 @@ String _getMessage(SemanticsNode node) {
...
@@ -200,8 +200,8 @@ String _getMessage(SemanticsNode node) {
final
List
<
String
>
annotations
=
<
String
>[];
final
List
<
String
>
annotations
=
<
String
>[];
bool
wantsTap
=
false
;
bool
wantsTap
=
false
;
if
(
data
.
hasFlag
(
SemanticsFlag
s
.
hasCheckedState
))
{
if
(
data
.
hasFlag
(
SemanticsFlag
.
hasCheckedState
))
{
annotations
.
add
(
data
.
hasFlag
(
SemanticsFlag
s
.
isChecked
)
?
'checked'
:
'unchecked'
);
annotations
.
add
(
data
.
hasFlag
(
SemanticsFlag
.
isChecked
)
?
'checked'
:
'unchecked'
);
wantsTap
=
true
;
wantsTap
=
true
;
}
}
...
...
packages/flutter/test/cupertino/button_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
...
@@ -189,7 +189,7 @@ void main() {
...
@@ -189,7 +189,7 @@ void main() {
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
label:
'ABC'
,
label:
'ABC'
,
flags:
SemanticsFlag
s
.
isButton
.
index
,
flags:
SemanticsFlag
.
isButton
.
index
,
)
)
],
],
),
),
...
...
packages/flutter/test/material/buttons_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
label:
'ABC'
,
label:
'ABC'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
88.0
,
36.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
88.0
,
36.0
),
transform:
new
Matrix4
.
translationValues
(
356.0
,
282.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
356.0
,
282.0
,
0.0
),
flags:
SemanticsFlag
s
.
isButton
.
index
,
flags:
SemanticsFlag
.
isButton
.
index
,
)
)
],
],
),
),
...
@@ -71,7 +71,7 @@ void main() {
...
@@ -71,7 +71,7 @@ void main() {
label:
'ABC'
,
label:
'ABC'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
88.0
,
36.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
88.0
,
36.0
),
transform:
new
Matrix4
.
translationValues
(
356.0
,
282.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
356.0
,
282.0
,
0.0
),
flags:
SemanticsFlag
s
.
isButton
.
index
,
flags:
SemanticsFlag
.
isButton
.
index
,
)
)
]
]
),
),
...
...
packages/flutter/test/material/card_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -49,7 +49,7 @@ void main() {
...
@@ -49,7 +49,7 @@ void main() {
label:
'Button'
,
label:
'Button'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
flags:
SemanticsFlag
s
.
isButton
.
index
,
flags:
SemanticsFlag
.
isButton
.
index
,
),
),
],
],
),
),
...
...
packages/flutter/test/material/control_list_tile_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -101,11 +101,11 @@ void main() {
...
@@ -101,11 +101,11 @@ void main() {
id:
1
,
id:
1
,
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
transform:
null
,
transform:
null
,
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
hasCheckedState
,
SemanticsFlag
.
hasCheckedState
,
SemanticsFlag
s
.
isChecked
,
SemanticsFlag
.
isChecked
,
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
s
.
isEnabled
SemanticsFlag
.
isEnabled
],
],
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
label:
'aaa
\n
AAA'
,
label:
'aaa
\n
AAA'
,
...
@@ -114,11 +114,11 @@ void main() {
...
@@ -114,11 +114,11 @@ void main() {
id:
4
,
id:
4
,
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
56.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
56.0
,
0.0
),
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
hasCheckedState
,
SemanticsFlag
.
hasCheckedState
,
SemanticsFlag
s
.
isChecked
,
SemanticsFlag
.
isChecked
,
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
s
.
isEnabled
SemanticsFlag
.
isEnabled
],
],
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
label:
'bbb
\n
BBB'
,
label:
'bbb
\n
BBB'
,
...
@@ -127,10 +127,10 @@ void main() {
...
@@ -127,10 +127,10 @@ void main() {
id:
7
,
id:
7
,
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
rect:
new
Rect
.
fromLTWH
(
0.0
,
0.0
,
800.0
,
56.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
112.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
112.0
,
0.0
),
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
hasCheckedState
,
SemanticsFlag
.
hasCheckedState
,
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
s
.
isEnabled
SemanticsFlag
.
isEnabled
],
],
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
label:
'CCC
\n
ccc'
,
label:
'CCC
\n
ccc'
,
...
...
packages/flutter/test/material/date_picker_test.dart
View file @
24e3f705
...
@@ -394,7 +394,7 @@ void _tests() {
...
@@ -394,7 +394,7 @@ void _tests() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isSelected
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isSelected
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'Fri, Jan 15'
,
label:
r'Fri, Jan 15'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
...
@@ -479,7 +479,7 @@ void _tests() {
...
@@ -479,7 +479,7 @@ void _tests() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isSelected
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isSelected
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'15, Friday, January 15, 2016'
,
label:
r'15, Friday, January 15, 2016'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
...
@@ -573,25 +573,25 @@ void _tests() {
...
@@ -573,25 +573,25 @@ void _tests() {
],
],
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'Previous month December 2015'
,
label:
r'Previous month December 2015'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'Next month February 2016'
,
label:
r'Next month February 2016'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'CANCEL'
,
label:
r'CANCEL'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'OK'
,
label:
r'OK'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
...
...
packages/flutter/test/material/icon_button_test.dart
View file @
24e3f705
...
@@ -292,7 +292,7 @@ void main() {
...
@@ -292,7 +292,7 @@ void main() {
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
48.0
,
48.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
48.0
,
48.0
),
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
label:
'link'
,
label:
'link'
,
)
)
]
]
...
...
packages/flutter/test/material/list_tile_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -361,23 +361,23 @@ void main() {
...
@@ -361,23 +361,23 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
label:
'one'
,
label:
'one'
,
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
s
.
isEnabled
,
SemanticsFlag
.
isEnabled
,
],
],
),
),
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
label:
'two'
,
label:
'two'
,
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
isSelected
,
SemanticsFlag
.
isSelected
,
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
s
.
isEnabled
,
SemanticsFlag
.
isEnabled
,
],
],
),
),
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
label:
'three'
,
label:
'three'
,
flags:
<
SemanticsFlag
s
>[
flags:
<
SemanticsFlag
>[
SemanticsFlag
s
.
hasEnabledState
,
SemanticsFlag
.
hasEnabledState
,
],
],
),
),
]
]
...
...
packages/flutter/test/material/tabs_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
,
SemanticsAction
;
import
'dart:ui'
show
SemanticsFlag
,
SemanticsAction
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -1214,7 +1214,7 @@ void main() {
...
@@ -1214,7 +1214,7 @@ void main() {
new
TestSemantics
(
new
TestSemantics
(
id:
2
,
id:
2
,
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
label:
'TAB #0
\n
Tab 1 of 2'
,
label:
'TAB #0
\n
Tab 1 of 2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
108.0
,
kTextTabBarHeight
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
108.0
,
kTextTabBarHeight
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
276.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
276.0
,
0.0
),
...
@@ -1464,7 +1464,7 @@ void main() {
...
@@ -1464,7 +1464,7 @@ void main() {
new
TestSemantics
(
new
TestSemantics
(
id:
24
,
id:
24
,
actions:
SemanticsAction
.
tap
.
index
,
actions:
SemanticsAction
.
tap
.
index
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
label:
'Semantics override 0
\n
Tab 1 of 2'
,
label:
'Semantics override 0
\n
Tab 1 of 2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
108.0
,
kTextTabBarHeight
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
108.0
,
kTextTabBarHeight
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
276.0
,
0.0
),
transform:
new
Matrix4
.
translationValues
(
0.0
,
276.0
,
0.0
),
...
...
packages/flutter/test/material/text_field_test.dart
View file @
24e3f705
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:async'
;
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
@@ -1666,7 +1666,7 @@ void main() {
...
@@ -1666,7 +1666,7 @@ void main() {
),
),
);
);
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isTextField
]));
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isTextField
]));
});
});
testWidgets
(
'Caret works when maxLines is null'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'Caret works when maxLines is null'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/material/user_accounts_drawer_header_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -69,7 +69,7 @@ Future<Null> pumpTestWidget(WidgetTester tester, {
...
@@ -69,7 +69,7 @@ Future<Null> pumpTestWidget(WidgetTester tester, {
void
main
(
)
{
void
main
(
)
{
testWidgets
(
'UserAccountsDrawerHeader test'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'UserAccountsDrawerHeader test'
,
(
WidgetTester
tester
)
async
{
await
pumpTestWidget
(
tester
);
await
pumpTestWidget
(
tester
);
expect
(
find
.
text
(
'A'
),
findsOneWidget
);
expect
(
find
.
text
(
'A'
),
findsOneWidget
);
expect
(
find
.
text
(
'B'
),
findsOneWidget
);
expect
(
find
.
text
(
'B'
),
findsOneWidget
);
expect
(
find
.
text
(
'C'
),
findsOneWidget
);
expect
(
find
.
text
(
'C'
),
findsOneWidget
);
...
@@ -351,7 +351,7 @@ void main() {
...
@@ -351,7 +351,7 @@ void main() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isButton
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isButton
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
],
label:
r'Show accounts'
,
label:
r'Show accounts'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
...
@@ -277,13 +277,13 @@ void main() {
...
@@ -277,13 +277,13 @@ void main() {
),
),
);
);
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isTextField
]));
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isTextField
]));
await
tester
.
tap
(
find
.
byType
(
EditableText
));
await
tester
.
tap
(
find
.
byType
(
EditableText
));
await
tester
.
idle
();
await
tester
.
idle
();
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isTextField
,
SemanticsFlags
.
isFocused
]));
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isTextField
,
SemanticsFlag
.
isFocused
]));
});
});
testWidgets
(
'EditableText includes text as value in semantics'
,
(
WidgetTester
tester
)
async
{
testWidgets
(
'EditableText includes text as value in semantics'
,
(
WidgetTester
tester
)
async
{
...
@@ -309,7 +309,7 @@ void main() {
...
@@ -309,7 +309,7 @@ void main() {
);
);
expect
(
semantics
,
includesNodeWith
(
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isTextField
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isTextField
],
value:
value1
,
value:
value1
,
));
));
...
@@ -319,7 +319,7 @@ void main() {
...
@@ -319,7 +319,7 @@ void main() {
await
tester
.
pump
();
await
tester
.
pump
();
expect
(
semantics
,
includesNodeWith
(
expect
(
semantics
,
includesNodeWith
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
isTextField
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
isTextField
],
value:
value2
,
value:
value2
,
));
));
});
});
...
...
packages/flutter/test/widgets/implicit_semantics_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
...
@@ -233,17 +233,17 @@ void main() {
...
@@ -233,17 +233,17 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
(
new
TestSemantics
(
id:
6
,
id:
6
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
label:
'node 1'
,
label:
'node 1'
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
7
,
id:
7
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
label:
'node 2'
,
label:
'node 2'
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
8
,
id:
8
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
label:
'node 3'
,
label:
'node 3'
,
),
),
],
],
...
...
packages/flutter/test/widgets/semantics_1_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -36,7 +36,7 @@ void main() {
...
@@ -36,7 +36,7 @@ void main() {
id:
1
,
id:
1
,
label:
'test1'
,
label:
'test1'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
)
)
]
]
)));
)));
...
@@ -78,7 +78,7 @@ void main() {
...
@@ -78,7 +78,7 @@ void main() {
id:
1
,
id:
1
,
label:
'child1'
,
label:
'child1'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
)
)
],
],
)));
)));
...
@@ -124,13 +124,13 @@ void main() {
...
@@ -124,13 +124,13 @@ void main() {
id:
2
,
id:
2
,
label:
'child1'
,
label:
'child1'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
3
,
id:
3
,
label:
'child2'
,
label:
'child2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
],
],
),
),
...
@@ -174,7 +174,7 @@ void main() {
...
@@ -174,7 +174,7 @@ void main() {
id:
1
,
id:
1
,
label:
'child1'
,
label:
'child1'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
)
)
],
],
)));
)));
...
@@ -220,13 +220,13 @@ void main() {
...
@@ -220,13 +220,13 @@ void main() {
id:
4
,
id:
4
,
label:
'child1'
,
label:
'child1'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
3
,
id:
3
,
label:
'child2'
,
label:
'child2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
],
],
),
),
...
...
packages/flutter/test/widgets/semantics_2_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -60,13 +60,13 @@ void main() {
...
@@ -60,13 +60,13 @@ void main() {
id:
2
,
id:
2
,
label:
'child1'
,
label:
'child1'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
3
,
id:
3
,
label:
'child2'
,
label:
'child2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
],
],
),
),
...
@@ -110,7 +110,7 @@ void main() {
...
@@ -110,7 +110,7 @@ void main() {
id:
1
,
id:
1
,
label:
'child1'
,
label:
'child1'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
)
)
],
],
)));
)));
...
@@ -156,13 +156,13 @@ void main() {
...
@@ -156,13 +156,13 @@ void main() {
id:
4
,
id:
4
,
label:
'child1'
,
label:
'child1'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
3
,
id:
3
,
label:
'child2'
,
label:
'child2'
,
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
rect:
new
Rect
.
fromLTRB
(
0.0
,
0.0
,
800.0
,
10.0
),
flags:
SemanticsFlag
s
.
isSelected
.
index
,
flags:
SemanticsFlag
.
isSelected
.
index
,
),
),
],
],
),
),
...
...
packages/flutter/test/widgets/semantics_3_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
...
@@ -37,7 +37,7 @@ void main() {
...
@@ -37,7 +37,7 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
'test'
,
label:
'test'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
)
)
...
@@ -62,7 +62,7 @@ void main() {
...
@@ -62,7 +62,7 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
]
]
...
@@ -116,7 +116,7 @@ void main() {
...
@@ -116,7 +116,7 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
'test'
,
label:
'test'
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
)
)
...
...
packages/flutter/test/widgets/semantics_4_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
...
@@ -64,12 +64,12 @@ void main() {
...
@@ -64,12 +64,12 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
(
new
TestSemantics
(
id:
3
,
id:
3
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
new
TestSemantics
(
new
TestSemantics
(
id:
4
,
id:
4
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
]
]
...
@@ -120,7 +120,7 @@ void main() {
...
@@ -120,7 +120,7 @@ void main() {
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
2
,
id:
2
,
label:
'L2'
,
label:
'L2'
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
],
],
...
@@ -160,7 +160,7 @@ void main() {
...
@@ -160,7 +160,7 @@ void main() {
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
2
,
id:
2
,
label:
'L2'
,
label:
'L2'
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
],
],
...
...
packages/flutter/test/widgets/semantics_7_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
...
@@ -56,14 +56,14 @@ void main() {
...
@@ -56,14 +56,14 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
label
,
label:
label
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
// IDs 2 and 3 are used up by the nodes that get merged in
// IDs 2 and 3 are used up by the nodes that get merged in
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
4
,
id:
4
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
label
,
label:
label
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
...
@@ -112,14 +112,14 @@ void main() {
...
@@ -112,14 +112,14 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
label
,
label:
label
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
// IDs 2 and 3 are used up by the nodes that get merged in
// IDs 2 and 3 are used up by the nodes that get merged in
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
4
,
id:
4
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
label
,
label:
label
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
),
),
...
...
packages/flutter/test/widgets/semantics_8_test.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter/widgets.dart'
;
...
@@ -42,7 +42,7 @@ void main() {
...
@@ -42,7 +42,7 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
'label'
,
label:
'label'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
...
@@ -80,7 +80,7 @@ void main() {
...
@@ -80,7 +80,7 @@ void main() {
children:
<
TestSemantics
>[
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
new
TestSemantics
.
rootChild
(
id:
1
,
id:
1
,
flags:
SemanticsFlag
s
.
hasCheckedState
.
index
|
SemanticsFlags
.
isChecked
.
index
,
flags:
SemanticsFlag
.
hasCheckedState
.
index
|
SemanticsFlag
.
isChecked
.
index
,
label:
'label'
,
label:
'label'
,
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
rect:
TestSemantics
.
fullScreen
,
rect:
TestSemantics
.
fullScreen
,
...
...
packages/flutter/test/widgets/semantics_tester.dart
View file @
24e3f705
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter/rendering.dart'
;
...
@@ -46,7 +46,7 @@ class TestSemantics {
...
@@ -46,7 +46,7 @@ class TestSemantics {
this
.
transform
,
this
.
transform
,
this
.
children
:
const
<
TestSemantics
>[],
this
.
children
:
const
<
TestSemantics
>[],
Iterable
<
SemanticsTag
>
tags
,
Iterable
<
SemanticsTag
>
tags
,
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
s
>),
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
label
!=
null
),
assert
(
value
!=
null
),
assert
(
value
!=
null
),
...
@@ -71,7 +71,7 @@ class TestSemantics {
...
@@ -71,7 +71,7 @@ class TestSemantics {
this
.
children
:
const
<
TestSemantics
>[],
this
.
children
:
const
<
TestSemantics
>[],
Iterable
<
SemanticsTag
>
tags
,
Iterable
<
SemanticsTag
>
tags
,
})
:
id
=
0
,
})
:
id
=
0
,
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
s
>),
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
label
!=
null
),
assert
(
increasedValue
!=
null
),
assert
(
increasedValue
!=
null
),
...
@@ -105,7 +105,7 @@ class TestSemantics {
...
@@ -105,7 +105,7 @@ class TestSemantics {
Matrix4
transform
,
Matrix4
transform
,
this
.
children
:
const
<
TestSemantics
>[],
this
.
children
:
const
<
TestSemantics
>[],
Iterable
<
SemanticsTag
>
tags
,
Iterable
<
SemanticsTag
>
tags
,
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
s
>),
})
:
assert
(
flags
is
int
||
flags
is
List
<
SemanticsFlag
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
actions
is
int
||
actions
is
List
<
SemanticsAction
>),
assert
(
label
!=
null
),
assert
(
label
!=
null
),
assert
(
value
!=
null
),
assert
(
value
!=
null
),
...
@@ -122,12 +122,12 @@ class TestSemantics {
...
@@ -122,12 +122,12 @@ class TestSemantics {
/// they are created.
/// they are created.
final
int
id
;
final
int
id
;
/// The [SemanticsFlag
s]
set on this node.
/// The [SemanticsFlag
]s
set on this node.
///
///
/// There are two ways to specify this property: as an `int` that encodes the
/// There are two ways to specify this property: as an `int` that encodes the
/// flags as a bit field, or as a `List<SemanticsFlag
s
>` that are _on_.
/// flags as a bit field, or as a `List<SemanticsFlag>` that are _on_.
///
///
/// Using `List<SemanticsFlag
s
>` is recommended due to better readability.
/// Using `List<SemanticsFlag>` is recommended due to better readability.
final
dynamic
flags
;
final
dynamic
flags
;
/// The [SemanticsAction]s set on this node.
/// The [SemanticsAction]s set on this node.
...
@@ -223,7 +223,7 @@ class TestSemantics {
...
@@ -223,7 +223,7 @@ class TestSemantics {
final
int
flagsBitmask
=
flags
is
int
final
int
flagsBitmask
=
flags
is
int
?
flags
?
flags
:
flags
.
fold
<
int
>(
0
,
(
int
bitmask
,
SemanticsFlag
s
flag
)
=>
bitmask
|
flag
.
index
);
:
flags
.
fold
<
int
>(
0
,
(
int
bitmask
,
SemanticsFlag
flag
)
=>
bitmask
|
flag
.
index
);
if
(
flagsBitmask
!=
nodeData
.
flags
)
if
(
flagsBitmask
!=
nodeData
.
flags
)
return
fail
(
'expected node id
$id
to have flags
$flags
but found flags
${nodeData.flags}
.'
);
return
fail
(
'expected node id
$id
to have flags
$flags
but found flags
${nodeData.flags}
.'
);
...
@@ -277,8 +277,8 @@ class TestSemantics {
...
@@ -277,8 +277,8 @@ class TestSemantics {
buf
.
writeln
(
'
${indent}
new
$runtimeType
('
);
buf
.
writeln
(
'
${indent}
new
$runtimeType
('
);
if
(
id
!=
null
)
if
(
id
!=
null
)
buf
.
writeln
(
'
$indent
id:
$id
,'
);
buf
.
writeln
(
'
$indent
id:
$id
,'
);
if
(
flags
is
int
&&
flags
!=
0
||
flags
is
List
<
SemanticsFlag
s
>
&&
flags
.
isNotEmpty
)
if
(
flags
is
int
&&
flags
!=
0
||
flags
is
List
<
SemanticsFlag
>
&&
flags
.
isNotEmpty
)
buf
.
writeln
(
'
$indent
flags:
${SemanticsTester._flagsToSemanticsFlag
s
Expression(flags)}
,'
);
buf
.
writeln
(
'
$indent
flags:
${SemanticsTester._flagsToSemanticsFlagExpression(flags)}
,'
);
if
(
actions
is
int
&&
actions
!=
0
||
actions
is
List
<
SemanticsAction
>
&&
actions
.
isNotEmpty
)
if
(
actions
is
int
&&
actions
!=
0
||
actions
is
List
<
SemanticsAction
>
&&
actions
.
isNotEmpty
)
buf
.
writeln
(
'
$indent
actions:
${SemanticsTester._actionsToSemanticsActionExpression(actions)}
,'
);
buf
.
writeln
(
'
$indent
actions:
${SemanticsTester._actionsToSemanticsActionExpression(actions)}
,'
);
if
(
label
!=
null
&&
label
!=
''
)
if
(
label
!=
null
&&
label
!=
''
)
...
@@ -347,7 +347,7 @@ class SemanticsTester {
...
@@ -347,7 +347,7 @@ class SemanticsTester {
String
value
,
String
value
,
TextDirection
textDirection
,
TextDirection
textDirection
,
List
<
SemanticsAction
>
actions
,
List
<
SemanticsAction
>
actions
,
List
<
SemanticsFlag
s
>
flags
,
List
<
SemanticsFlag
>
flags
,
SemanticsNode
ancestor
,
SemanticsNode
ancestor
,
})
{
})
{
bool
checkNode
(
SemanticsNode
node
)
{
bool
checkNode
(
SemanticsNode
node
)
{
...
@@ -364,7 +364,7 @@ class SemanticsTester {
...
@@ -364,7 +364,7 @@ class SemanticsTester {
return
false
;
return
false
;
}
}
if
(
flags
!=
null
)
{
if
(
flags
!=
null
)
{
final
int
expectedFlags
=
flags
.
fold
(
0
,
(
int
value
,
SemanticsFlag
s
flag
)
=>
value
|
flag
.
index
);
final
int
expectedFlags
=
flags
.
fold
(
0
,
(
int
value
,
SemanticsFlag
flag
)
=>
value
|
flag
.
index
);
final
int
actualFlags
=
node
.
getSemanticsData
().
flags
;
final
int
actualFlags
=
node
.
getSemanticsData
().
flags
;
if
(
expectedFlags
!=
actualFlags
)
if
(
expectedFlags
!=
actualFlags
)
return
false
;
return
false
;
...
@@ -440,15 +440,15 @@ class SemanticsTester {
...
@@ -440,15 +440,15 @@ class SemanticsTester {
return
_generateSemanticsTestForNode
(
node
,
0
);
return
_generateSemanticsTestForNode
(
node
,
0
);
}
}
static
String
_flagsToSemanticsFlag
s
Expression
(
dynamic
flags
)
{
static
String
_flagsToSemanticsFlagExpression
(
dynamic
flags
)
{
Iterable
<
SemanticsFlag
s
>
list
;
Iterable
<
SemanticsFlag
>
list
;
if
(
flags
is
int
)
{
if
(
flags
is
int
)
{
list
=
SemanticsFlag
s
.
values
.
values
list
=
SemanticsFlag
.
values
.
values
.
where
((
SemanticsFlag
s
flag
)
=>
(
flag
.
index
&
flags
)
!=
0
);
.
where
((
SemanticsFlag
flag
)
=>
(
flag
.
index
&
flags
)
!=
0
);
}
else
{
}
else
{
list
=
flags
;
list
=
flags
;
}
}
return
'<SemanticsFlag
s
>[
${list.join(', ')}
]'
;
return
'<SemanticsFlag>[
${list.join(', ')}
]'
;
}
}
static
String
_actionsToSemanticsActionExpression
(
dynamic
actions
)
{
static
String
_actionsToSemanticsActionExpression
(
dynamic
actions
)
{
...
@@ -470,7 +470,7 @@ class SemanticsTester {
...
@@ -470,7 +470,7 @@ class SemanticsTester {
final
SemanticsData
nodeData
=
node
.
getSemanticsData
();
final
SemanticsData
nodeData
=
node
.
getSemanticsData
();
buf
.
writeln
(
'new TestSemantics('
);
buf
.
writeln
(
'new TestSemantics('
);
if
(
nodeData
.
flags
!=
0
)
if
(
nodeData
.
flags
!=
0
)
buf
.
writeln
(
' flags:
${_flagsToSemanticsFlag
s
Expression(nodeData.flags)}
,'
);
buf
.
writeln
(
' flags:
${_flagsToSemanticsFlagExpression(nodeData.flags)}
,'
);
if
(
nodeData
.
actions
!=
0
)
if
(
nodeData
.
actions
!=
0
)
buf
.
writeln
(
' actions:
${_actionsToSemanticsActionExpression(nodeData.actions)}
,'
);
buf
.
writeln
(
' actions:
${_actionsToSemanticsActionExpression(nodeData.actions)}
,'
);
if
(
node
.
label
!=
null
&&
node
.
label
.
isNotEmpty
)
if
(
node
.
label
!=
null
&&
node
.
label
.
isNotEmpty
)
...
@@ -555,7 +555,7 @@ class _IncludesNodeWith extends Matcher {
...
@@ -555,7 +555,7 @@ class _IncludesNodeWith extends Matcher {
final
String
value
;
final
String
value
;
final
TextDirection
textDirection
;
final
TextDirection
textDirection
;
final
List
<
SemanticsAction
>
actions
;
final
List
<
SemanticsAction
>
actions
;
final
List
<
SemanticsFlag
s
>
flags
;
final
List
<
SemanticsFlag
>
flags
;
@override
@override
bool
matches
(
covariant
SemanticsTester
item
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
bool
matches
(
covariant
SemanticsTester
item
,
Map
<
dynamic
,
dynamic
>
matchState
)
{
...
@@ -603,7 +603,7 @@ Matcher includesNodeWith({
...
@@ -603,7 +603,7 @@ Matcher includesNodeWith({
String
value
,
String
value
,
TextDirection
textDirection
,
TextDirection
textDirection
,
List
<
SemanticsAction
>
actions
,
List
<
SemanticsAction
>
actions
,
List
<
SemanticsFlag
s
>
flags
,
List
<
SemanticsFlag
>
flags
,
})
{
})
{
return
new
_IncludesNodeWith
(
return
new
_IncludesNodeWith
(
label:
label
,
label:
label
,
...
...
packages/flutter/test/widgets/semantics_tester_generateTestSemanticsExpressionForCurrentSemanticsTree_test.dart
View file @
24e3f705
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
'dart:async'
;
import
'dart:async'
;
import
'dart:io'
;
import
'dart:io'
;
import
'dart:ui'
show
SemanticsFlag
s
;
import
'dart:ui'
show
SemanticsFlag
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/semantics.dart'
;
import
'package:flutter/semantics.dart'
;
...
@@ -113,7 +113,7 @@ void _tests() {
...
@@ -113,7 +113,7 @@ void _tests() {
textDirection:
TextDirection
.
ltr
,
textDirection:
TextDirection
.
ltr
,
),
),
new
TestSemantics
(
new
TestSemantics
(
flags:
<
SemanticsFlag
s
>[
SemanticsFlags
.
hasCheckedState
,
SemanticsFlags
.
isChecked
,
SemanticsFlags
.
isSelected
],
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
hasCheckedState
,
SemanticsFlag
.
isChecked
,
SemanticsFlag
.
isSelected
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
,
SemanticsAction
.
decrease
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
,
SemanticsAction
.
decrease
],
label:
r'Interactive text'
,
label:
r'Interactive text'
,
value:
r'test-value'
,
value:
r'test-value'
,
...
...
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