Slider Visual Update (#14901)
This implements an update to the look of the Slider widget. Specifically, it does the following: * Adds the ability to customize the colors of all components of the slider * Adds the ability to customize the shape of the slider thumb and value indicator * Adds the ability to show the value indicator on continuous sliders * Updates the default value indicator to be a "paddle" shape with new animations. * Changes the tick marks to be visible all the time on discrete sliders * Fixes a memory leak of an animation controller. * Removes "thumbOpenAtMin" flag, which is no longer needed, and can be emulated by the custom thumb shape support. It was not widely used. * Adds tests for all of the new features.
This commit is contained in:
@@ -31,7 +31,6 @@ class _SliderDemoState extends State<SliderDemo> {
|
||||
value: _value,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
thumbOpenAtMin: true,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_value = value;
|
||||
@@ -44,7 +43,7 @@ class _SliderDemoState extends State<SliderDemo> {
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: const <Widget> [
|
||||
const Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null),
|
||||
const Slider(value: 0.25, onChanged: null),
|
||||
const Text('Disabled'),
|
||||
]
|
||||
),
|
||||
@@ -57,7 +56,6 @@ class _SliderDemoState extends State<SliderDemo> {
|
||||
max: 100.0,
|
||||
divisions: 5,
|
||||
label: '${_discreteValue.round()}',
|
||||
thumbOpenAtMin: true,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_discreteValue = value;
|
||||
|
||||
Reference in New Issue
Block a user