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
cded7efb
Unverified
Commit
cded7efb
authored
Jul 30, 2018
by
xster
Committed by
GitHub
Jul 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CupertinoSwitch accessibility (#19927)
parent
dfe5b591
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
36 deletions
+46
-36
cupertino_switch_demo.dart
...ter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
+43
-34
switch.dart
packages/flutter/lib/src/cupertino/switch.dart
+3
-2
No files found.
examples/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
View file @
cded7efb
...
...
@@ -26,42 +26,51 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
child:
new
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
children:
<
Widget
>[
new
Column
(
children:
<
Widget
>[
new
CupertinoSwitch
(
value:
_switchValue
,
onChanged:
(
bool
value
)
{
setState
(()
{
_switchValue
=
value
;
});
},
),
const
Text
(
'Active'
),
],
new
Semantics
(
container:
true
,
child:
new
Column
(
children:
<
Widget
>[
new
CupertinoSwitch
(
value:
_switchValue
,
onChanged:
(
bool
value
)
{
setState
(()
{
_switchValue
=
value
;
});
},
),
const
Text
(
'Active'
),
],
),
),
new
Column
(
children:
const
<
Widget
>[
const
CupertinoSwitch
(
value:
true
,
onChanged:
null
,
),
const
Text
(
'Disabled'
),
],
new
Semantics
(
container:
true
,
child:
new
Column
(
children:
const
<
Widget
>[
const
CupertinoSwitch
(
value:
true
,
onChanged:
null
,
),
const
Text
(
'Disabled'
),
],
),
),
new
Column
(
children:
const
<
Widget
>[
const
CupertinoSwitch
(
value:
false
,
onChanged:
null
,
),
const
Text
(
'Disabled'
),
],
new
Semantics
(
container:
true
,
child:
new
Column
(
children:
const
<
Widget
>[
const
CupertinoSwitch
(
value:
false
,
onChanged:
null
,
),
const
Text
(
'Disabled'
),
],
),
),
],
),
...
...
packages/flutter/lib/src/cupertino/switch.dart
View file @
cded7efb
...
...
@@ -380,10 +380,11 @@ class _RenderCupertinoSwitch extends RenderConstrainedBox {
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
super
.
describeSemanticsConfiguration
(
config
);
config
.
isSemanticBoundary
=
isInteractive
;
if
(
isInteractive
)
config
.
onTap
=
_handleTap
;
config
.
isChecked
=
_value
;
config
.
isEnabled
=
isInteractive
;
config
.
isToggled
=
_value
;
}
final
CupertinoThumbPainter
_thumbPainter
=
new
CupertinoThumbPainter
();
...
...
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