Unverified Commit 3f30b613 authored by Jose Alba's avatar Jose Alba Committed by GitHub

Migrating old Gallery to new Slider (#55201)

parent 78bf9ba4
...@@ -305,6 +305,7 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> { ...@@ -305,6 +305,7 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
// Allow room for the value indicator. // Allow room for the value indicator.
padding: const EdgeInsets.only(top: 44.0), padding: const EdgeInsets.only(top: 44.0),
child: Slider( child: Slider(
useV2Slider: true,
min: 0.0, min: 0.0,
max: 100.0, max: 100.0,
divisions: 5, divisions: 5,
......
...@@ -274,6 +274,7 @@ class _SlidersState extends State<_Sliders> { ...@@ -274,6 +274,7 @@ class _SlidersState extends State<_Sliders> {
), ),
), ),
Slider.adaptive( Slider.adaptive(
useV2Slider: true,
label: _continuousValue.toStringAsFixed(6).toString(), label: _continuousValue.toStringAsFixed(6).toString(),
value: _continuousValue, value: _continuousValue,
min: 0.0, min: 0.0,
...@@ -290,7 +291,7 @@ class _SlidersState extends State<_Sliders> { ...@@ -290,7 +291,7 @@ class _SlidersState extends State<_Sliders> {
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: const <Widget>[
Slider.adaptive(value: 0.25, onChanged: null), Slider.adaptive(useV2Slider: true, value: 0.25, onChanged: null),
Text('Disabled'), Text('Disabled'),
], ],
), ),
...@@ -298,6 +299,7 @@ class _SlidersState extends State<_Sliders> { ...@@ -298,6 +299,7 @@ class _SlidersState extends State<_Sliders> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Slider.adaptive( Slider.adaptive(
useV2Slider: true,
value: _discreteValue, value: _discreteValue,
min: 0.0, min: 0.0,
max: 200.0, max: 200.0,
...@@ -329,6 +331,7 @@ class _SlidersState extends State<_Sliders> { ...@@ -329,6 +331,7 @@ class _SlidersState extends State<_Sliders> {
valueIndicatorTextStyle: theme.accentTextTheme.bodyText1.copyWith(color: theme.colorScheme.onSurface), valueIndicatorTextStyle: theme.accentTextTheme.bodyText1.copyWith(color: theme.colorScheme.onSurface),
), ),
child: Slider( child: Slider(
useV2Slider: true,
value: _discreteCustomValue, value: _discreteCustomValue,
min: 0.0, min: 0.0,
max: 200.0, max: 200.0,
...@@ -372,6 +375,7 @@ class _RangeSlidersState extends State<_RangeSliders> { ...@@ -372,6 +375,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
RangeSlider( RangeSlider(
useV2Slider: true,
values: _continuousValues, values: _continuousValues,
min: 0.0, min: 0.0,
max: 100.0, max: 100.0,
...@@ -387,7 +391,7 @@ class _RangeSlidersState extends State<_RangeSliders> { ...@@ -387,7 +391,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
RangeSlider(values: const RangeValues(0.25, 0.75), onChanged: null), RangeSlider(useV2Slider: true, values: const RangeValues(0.25, 0.75), onChanged: null),
const Text('Disabled'), const Text('Disabled'),
], ],
), ),
...@@ -395,6 +399,7 @@ class _RangeSlidersState extends State<_RangeSliders> { ...@@ -395,6 +399,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
RangeSlider( RangeSlider(
useV2Slider: true,
values: _discreteValues, values: _discreteValues,
min: 0.0, min: 0.0,
max: 200.0, max: 200.0,
...@@ -424,6 +429,7 @@ class _RangeSlidersState extends State<_RangeSliders> { ...@@ -424,6 +429,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
showValueIndicator: ShowValueIndicator.never, showValueIndicator: ShowValueIndicator.never,
), ),
child: RangeSlider( child: RangeSlider(
useV2Slider: true,
values: _discreteCustomValues, values: _discreteCustomValues,
min: 0.0, min: 0.0,
max: 200.0, max: 200.0,
......
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