Custom switch images are nutty (#4852)

Rather than requiring the developer to specify a full Decoration, we now
just take an ImageProvider for the thumb image. Also, fix
ImageFit.scaleDown to actually work.

Fixes #4571
Fixes #4673
This commit is contained in:
Adam Barth
2016-07-08 09:51:51 -07:00
committed by GitHub
parent d7a4a54b36
commit fc711a10cd
4 changed files with 76 additions and 102 deletions

View File

@@ -168,11 +168,14 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
child: new Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Switch(value: switchValue, onChanged: (bool value) {
setState(() {
new Switch(
value: switchValue,
onChanged: (bool value) {
setState(() {
switchValue = value;
});
}),
});
}
),
// Disabled switches
new Switch(value: true, onChanged: null),
new Switch(value: false, onChanged: null)