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
5d03a593
Unverified
Commit
5d03a593
authored
Mar 09, 2018
by
Michael Goderbauer
Committed by
GitHub
Mar 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow wrapping CheckBox in Semantics (#15259)
parent
7d1ceb40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
toggleable.dart
packages/flutter/lib/src/material/toggleable.dart
+0
-1
checkbox_test.dart
packages/flutter/test/material/checkbox_test.dart
+39
-0
No files found.
packages/flutter/lib/src/material/toggleable.dart
View file @
5d03a593
...
...
@@ -329,7 +329,6 @@ abstract class RenderToggleable extends RenderConstrainedBox {
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
super
.
describeSemanticsConfiguration
(
config
);
config
.
isSemanticBoundary
=
true
;
config
.
isEnabled
=
isInteractive
;
if
(
isInteractive
)
config
.
onTap
=
_handleTap
;
...
...
packages/flutter/test/material/checkbox_test.dart
View file @
5d03a593
...
...
@@ -11,6 +11,10 @@ import 'package:flutter/material.dart';
import
'../widgets/semantics_tester.dart'
;
void
main
(
)
{
setUp
(()
{
debugResetSemanticsIdCounter
();
});
testWidgets
(
'CheckBox semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
...
...
@@ -103,6 +107,41 @@ void main() {
semantics
.
dispose
();
});
testWidgets
(
'Can wrap CheckBox with Semantics'
,
(
WidgetTester
tester
)
async
{
final
SemanticsTester
semantics
=
new
SemanticsTester
(
tester
);
await
tester
.
pumpWidget
(
new
Material
(
child:
new
Semantics
(
label:
'foo'
,
textDirection:
TextDirection
.
ltr
,
child:
new
Checkbox
(
value:
false
,
onChanged:
(
bool
b
)
{
},
),
),
));
expect
(
semantics
,
hasSemantics
(
new
TestSemantics
.
root
(
children:
<
TestSemantics
>[
new
TestSemantics
.
rootChild
(
id:
1
,
label:
'foo'
,
textDirection:
TextDirection
.
ltr
,
flags:
<
SemanticsFlag
>[
SemanticsFlag
.
hasCheckedState
,
SemanticsFlag
.
hasEnabledState
,
SemanticsFlag
.
isEnabled
,
],
actions:
<
SemanticsAction
>[
SemanticsAction
.
tap
,
],
),
],
),
ignoreRect:
true
,
ignoreTransform:
true
));
semantics
.
dispose
();
});
testWidgets
(
'CheckBox tristate: true'
,
(
WidgetTester
tester
)
async
{
bool
checkBoxValue
;
...
...
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