Unverified Commit 49bcda52 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

remove ExcludeSemantics from bottom app bar demo (#18033)

parent 87a6e2b4
...@@ -97,19 +97,19 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> { ...@@ -97,19 +97,19 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
// App bar color // App bar color
static const List<Color> kBabColors = const <Color>[ static const List<_NamedColor> kBabColors = const <_NamedColor>[
null, const _NamedColor(null, 'Clear'),
const Color(0xFFFFC100), const _NamedColor(const Color(0xFFFFC100), 'Orange'),
const Color(0xFF91FAFF), const _NamedColor(const Color(0xFF91FAFF), 'Light Blue'),
const Color(0xFF00D1FF), const _NamedColor(const Color(0xFF00D1FF), 'Cyan'),
const Color(0xFF00BCFF), const _NamedColor(const Color(0xFF00BCFF), 'Cerulean'),
const Color(0xFF009BEE), const _NamedColor(const Color(0xFF009BEE), 'Blue'),
]; ];
_ChoiceValue<Widget> _fabShape = kCircularFab; _ChoiceValue<Widget> _fabShape = kCircularFab;
_ChoiceValue<bool> _showNotch = kShowNotchTrue; _ChoiceValue<bool> _showNotch = kShowNotchTrue;
_ChoiceValue<FloatingActionButtonLocation> _fabLocation = kFabEndDocked; _ChoiceValue<FloatingActionButtonLocation> _fabLocation = kFabEndDocked;
Color _babColor = kBabColors.first; Color _babColor = kBabColors.first.color;
void _onShowNotchChanged(_ChoiceValue<bool> value) { void _onShowNotchChanged(_ChoiceValue<bool> value) {
setState(() { setState(() {
...@@ -250,37 +250,46 @@ class _RadioItem<T> extends StatelessWidget { ...@@ -250,37 +250,46 @@ class _RadioItem<T> extends StatelessWidget {
} }
} }
class _NamedColor {
const _NamedColor(this.color, this.name);
final Color color;
final String name;
}
class _ColorsItem extends StatelessWidget { class _ColorsItem extends StatelessWidget {
const _ColorsItem(this.colors, this.selectedColor, this.onChanged); const _ColorsItem(this.colors, this.selectedColor, this.onChanged);
final List<Color> colors; final List<_NamedColor> colors;
final Color selectedColor; final Color selectedColor;
final ValueChanged<Color> onChanged; final ValueChanged<Color> onChanged;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new ExcludeSemantics( return new Row(
child: new Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: colors.map((_NamedColor namedColor) {
children: colors.map((Color color) { return new RawMaterialButton(
return new RawMaterialButton( onPressed: () {
onPressed: () { onChanged(namedColor.color);
onChanged(color); },
}, constraints: const BoxConstraints.tightFor(
constraints: const BoxConstraints.tightFor( width: 32.0,
width: 32.0, height: 32.0,
height: 32.0, ),
), fillColor: namedColor.color,
fillColor: color, shape: new CircleBorder(
shape: new CircleBorder( side: new BorderSide(
side: new BorderSide( color: namedColor.color == selectedColor ? Colors.black : const Color(0xFFD5D7DA),
color: color == selectedColor ? Colors.black : const Color(0xFFD5D7DA), width: 2.0,
width: 2.0,
),
), ),
); ),
}).toList(), child: new Semantics(
), value: namedColor.name,
selected: namedColor.color == selectedColor,
),
);
}).toList(),
); );
} }
} }
......
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