Commit e0f6c0db authored by Adam Barth's avatar Adam Barth Committed by GitHub

Add labels to the slider demos (#5639)

Previously, it was unclear that the middle slider was disabled.

Fixes #5517
parent ea6bf470
...@@ -22,32 +22,46 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -22,32 +22,46 @@ class _SliderDemoState extends State<SliderDemo> {
body: new Column( body: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
new Center( new Column(
child: new Slider( mainAxisSize: MainAxisSize.min,
value: _value, children: <Widget> [
min: 0.0, new Slider(
max: 100.0, value: _value,
onChanged: (double value) { min: 0.0,
setState(() { max: 100.0,
_value = value; onChanged: (double value) {
}); setState(() {
} _value = value;
) });
}
),
new Text('Continuous'),
]
), ),
new Center(child: new Slider(value: 0.25, onChanged: null)), new Column(
new Center( mainAxisSize: MainAxisSize.min,
child: new Slider( children: <Widget> [
value: _discreteValue, new Slider(value: 0.25, onChanged: null),
min: 0.0, new Text('Disabled'),
max: 100.0, ]
divisions: 5, ),
label: '${_discreteValue.round()}', new Column(
onChanged: (double value) { mainAxisSize: MainAxisSize.min,
setState(() { children: <Widget> [
_discreteValue = value; new Slider(
}); value: _discreteValue,
} min: 0.0,
) max: 100.0,
divisions: 5,
label: '${_discreteValue.round()}',
onChanged: (double value) {
setState(() {
_discreteValue = value;
});
}
),
new Text('Discrete'),
]
), ),
] ]
) )
......
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