Commit 47a576b2 authored by ztplz's avatar ztplz Committed by xster

Add disable Cupertino Switch example (#15853)

* Add disable Cupertino Switch example

* keep trailing commas consistent

* fix Cupertino Switch example linter error
parent 13c6ee4f
...@@ -23,13 +23,47 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> { ...@@ -23,13 +23,47 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
title: const Text('Cupertino Switch'), title: const Text('Cupertino Switch'),
), ),
body: new Center( body: new Center(
child: new CupertinoSwitch( child: new Column(
value: _switchValue, mainAxisAlignment: MainAxisAlignment.spaceAround,
onChanged: (bool value) { children: <Widget>[
setState(() { new Column(
_switchValue = value; children: <Widget>[
}); new CupertinoSwitch(
} value: _switchValue,
onChanged: (bool value) {
setState(() {
_switchValue = value;
});
},
),
const Text(
'Active'
),
],
),
new Column(
children: <Widget>[
new CupertinoSwitch(
value: true,
onChanged: null,
),
const Text(
'Disabled'
),
],
),
new Column(
children: <Widget>[
new CupertinoSwitch(
value: false,
onChanged: null,
),
const Text(
'Disabled'
),
],
),
],
), ),
), ),
); );
......
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