Add disable Cupertino Switch example (#15853)
* Add disable Cupertino Switch example * keep trailing commas consistent * fix Cupertino Switch example linter error
This commit is contained in:
@@ -23,13 +23,47 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
|
||||
title: const Text('Cupertino Switch'),
|
||||
),
|
||||
body: new Center(
|
||||
child: new CupertinoSwitch(
|
||||
value: _switchValue,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
_switchValue = value;
|
||||
});
|
||||
}
|
||||
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 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'
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user