Material Switch optionally adapts per platform: Switch.adaptive() (#22688)

This commit is contained in:
Hans Muller
2018-10-08 10:39:59 -07:00
committed by GitHub
parent d422e85f5b
commit bbb080b3a3
3 changed files with 141 additions and 21 deletions

View File

@@ -187,7 +187,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Switch(
Switch.adaptive(
value: switchValue,
onChanged: (bool value) {
setState(() {
@@ -196,8 +196,8 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
}
),
// Disabled switches
const Switch(value: true, onChanged: null),
const Switch(value: false, onChanged: null)
const Switch.adaptive(value: true, onChanged: null),
const Switch.adaptive(value: false, onChanged: null),
],
),
);