Commit 792c9875 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

a11y fix for list_demo.dart (#11142)

* a11y fix for list_demo.dart

* fix semantics of persistant bottom sheet
parent 18d9b20f
...@@ -58,7 +58,8 @@ class _ListDemoState extends State<ListDemo> { ...@@ -58,7 +58,8 @@ class _ListDemoState extends State<ListDemo> {
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
children: <Widget>[ children: <Widget>[
new ListTile( new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('One-line'), title: const Text('One-line'),
trailing: new Radio<_MaterialListType>( trailing: new Radio<_MaterialListType>(
...@@ -67,7 +68,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -67,7 +68,9 @@ class _ListDemoState extends State<ListDemo> {
onChanged: changeItemType, onChanged: changeItemType,
) )
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Two-line'), title: const Text('Two-line'),
trailing: new Radio<_MaterialListType>( trailing: new Radio<_MaterialListType>(
...@@ -76,7 +79,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -76,7 +79,9 @@ class _ListDemoState extends State<ListDemo> {
onChanged: changeItemType, onChanged: changeItemType,
) )
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Three-line'), title: const Text('Three-line'),
trailing: new Radio<_MaterialListType>( trailing: new Radio<_MaterialListType>(
...@@ -85,7 +90,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -85,7 +90,9 @@ class _ListDemoState extends State<ListDemo> {
onChanged: changeItemType, onChanged: changeItemType,
), ),
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Show avatar'), title: const Text('Show avatar'),
trailing: new Checkbox( trailing: new Checkbox(
...@@ -98,7 +105,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -98,7 +105,9 @@ class _ListDemoState extends State<ListDemo> {
}, },
), ),
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Show icon'), title: const Text('Show icon'),
trailing: new Checkbox( trailing: new Checkbox(
...@@ -111,7 +120,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -111,7 +120,9 @@ class _ListDemoState extends State<ListDemo> {
}, },
), ),
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Show dividers'), title: const Text('Show dividers'),
trailing: new Checkbox( trailing: new Checkbox(
...@@ -124,7 +135,9 @@ class _ListDemoState extends State<ListDemo> { ...@@ -124,7 +135,9 @@ class _ListDemoState extends State<ListDemo> {
}, },
), ),
), ),
new ListTile( ),
new MergeSemantics(
child: new ListTile(
dense: true, dense: true,
title: const Text('Dense layout'), title: const Text('Dense layout'),
trailing: new Checkbox( trailing: new Checkbox(
...@@ -137,6 +150,7 @@ class _ListDemoState extends State<ListDemo> { ...@@ -137,6 +150,7 @@ class _ListDemoState extends State<ListDemo> {
}, },
), ),
), ),
),
], ],
), ),
); );
...@@ -164,13 +178,15 @@ class _ListDemoState extends State<ListDemo> { ...@@ -164,13 +178,15 @@ class _ListDemoState extends State<ListDemo> {
"Even more additional list item information appears on line three.", "Even more additional list item information appears on line three.",
); );
} }
return new ListTile( return new MergeSemantics(
child: new ListTile(
isThreeLine: _itemType == _MaterialListType.threeLine, isThreeLine: _itemType == _MaterialListType.threeLine,
dense: _dense, dense: _dense,
leading: _showAvatars ? new CircleAvatar(child: new Text(item)) : null, leading: _showAvatars ? new ExcludeSemantics(child: new CircleAvatar(child: new Text(item))) : null,
title: new Text('This item represents $item.'), title: new Text('This item represents $item.'),
subtitle: secondary, subtitle: secondary,
trailing: _showIcons ? new Icon(Icons.info, color: Theme.of(context).disabledColor) : null, trailing: _showIcons ? new Icon(Icons.info, color: Theme.of(context).disabledColor) : null,
),
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment