@@ -1673,9 +1673,13 @@ class RectangularSliderTrackShape extends SliderTrackShape with BaseSliderTrackS
1673
1673
/// * [RectangularSliderTrackShape] , for a similar track with sharp edges.
1674
1674
class RoundedRectSliderTrackShape extends SliderTrackShape with BaseSliderTrackShape {
1675
1675
/// Create a slider track that draws two rectangles with rounded outer edges.
1676
- const RoundedRectSliderTrackShape ({ this .useV2Slider = false });
1676
+ const RoundedRectSliderTrackShape ({ this .useV2Slider = true });
1677
1677
1678
1678
/// {@macro flutter.material.slider.useV2Slider}
1679
+ @Deprecated (
1680
+ 'This flag has changed to true by default and no longer needed. '
1681
+ 'This feature was deprecated after v1.18.0.'
1682
+ )
1679
1683
final bool useV2Slider;
1680
1684
1681
1685
@override
@@ -1739,6 +1743,7 @@ class RoundedRectSliderTrackShape extends SliderTrackShape with BaseSliderTrackS
1739
1743
final Radius trackRadius = Radius .circular (trackRect.height / 2 );
1740
1744
final Radius activeTrackRadius = Radius .circular (trackRect.height / 2 + 1 );
1741
1745
1746
+ // ignore: deprecated_member_use_from_same_package
1742
1747
if (useV2Slider) {
1743
1748
context.canvas.drawRRect (
1744
1749
RRect .fromLTRBAndCorners (
@@ -1813,6 +1818,10 @@ class RectangularRangeSliderTrackShape extends RangeSliderTrackShape {
1813
1818
const RectangularRangeSliderTrackShape ({this .useV2Slider});
1814
1819
1815
1820
/// {@macro flutter.material.slider.useV2Slider}
1821
+ @Deprecated (
1822
+ 'This flag has changed to true by default and no longer needed. '
1823
+ 'This feature was deprecated after v1.18.0.'
1824
+ )
1816
1825
final bool useV2Slider;
1817
1826
1818
1827
@override
@@ -1942,6 +1951,10 @@ class RoundedRectRangeSliderTrackShape extends RangeSliderTrackShape {
1942
1951
const RoundedRectRangeSliderTrackShape ({ this .useV2Slider });
1943
1952
1944
1953
/// {@macro flutter.material.slider.useV2Slider}
1954
+ @Deprecated (
1955
+ 'This flag has changed to true by default and no longer needed. '
1956
+ 'This feature was deprecated after v1.18.0.'
1957
+ )
1945
1958
final bool useV2Slider;
1946
1959
1947
1960
@override
@@ -2043,6 +2056,7 @@ class RoundedRectRangeSliderTrackShape extends RangeSliderTrackShape {
2043
2056
isDiscrete: isDiscrete,
2044
2057
);
2045
2058
2059
+ // ignore: deprecated_member_use_from_same_package
2046
2060
if (useV2Slider) {
2047
2061
final Radius trackRadius = Radius .circular (trackRect.height / 2 );
2048
2062
@@ -2123,17 +2137,23 @@ class RoundSliderTickMarkShape extends SliderTickMarkShape {
2123
2137
/// Create a slider tick mark that draws a circle.
2124
2138
const RoundSliderTickMarkShape ({
2125
2139
this .tickMarkRadius,
2126
- this .useV2Slider = false ,
2140
+ this .useV2Slider = true ,
2127
2141
});
2128
2142
2129
2143
/// The preferred radius of the round tick mark.
2130
2144
///
2145
+ // ignore: deprecated_member_use_from_same_package
2131
2146
/// If it is not provided, and [useV2Slider] is true, then 1/4 of the
2132
2147
/// [SliderThemeData.trackHeight] is used. If it is not provided, and
2148
+ // ignore: deprecated_member_use_from_same_package
2133
2149
/// [useV2Slider] is false, then half of the track height is used.
2134
2150
final double tickMarkRadius;
2135
2151
2136
2152
/// {@macro flutter.material.slider.useV2Slider}
2153
+ @Deprecated (
2154
+ 'This flag has changed to true by default and no longer needed. '
2155
+ 'This feature was deprecated after v1.18.0.'
2156
+ )
2137
2157
final bool useV2Slider;
2138
2158
2139
2159
@override
@@ -2148,6 +2168,7 @@ class RoundSliderTickMarkShape extends SliderTickMarkShape {
2148
2168
// radius is defaulted to be a fraction of the
2149
2169
// [SliderThemeData.trackHeight]. The fraction is 1/4 when [useV2Slider] is
2150
2170
// true, and 1/2 when it is false.
2171
+ // ignore: deprecated_member_use_from_same_package
2151
2172
return Size .fromRadius (tickMarkRadius ?? sliderTheme.trackHeight / (useV2Slider ? 4 : 2 ));
2152
2173
}
2153
2174
@@ -2225,17 +2246,23 @@ class RoundRangeSliderTickMarkShape extends RangeSliderTickMarkShape {
2225
2246
/// Create a range slider tick mark that draws a circle.
2226
2247
const RoundRangeSliderTickMarkShape ({
2227
2248
this .tickMarkRadius,
2228
- this .useV2Slider = false ,
2249
+ this .useV2Slider = true ,
2229
2250
});
2230
2251
2231
2252
/// The preferred radius of the round tick mark.
2232
2253
///
2254
+ // ignore: deprecated_member_use_from_same_package
2233
2255
/// If it is not provided, and [useV2Slider] is true, then 1/4 of the
2234
2256
/// [SliderThemeData.trackHeight] is used. If it is not provided, and
2257
+ // ignore: deprecated_member_use_from_same_package
2235
2258
/// [useV2Slider] is false, then half of the track height is used.
2236
2259
final double tickMarkRadius;
2237
2260
2238
2261
/// {@macro flutter.material.slider.useV2Slider}
2262
+ @Deprecated (
2263
+ 'This flag has changed to true by default and no longer needed. '
2264
+ 'This feature was deprecated after v1.18.0.'
2265
+ )
2239
2266
final bool useV2Slider;
2240
2267
2241
2268
@override
@@ -2246,6 +2273,7 @@ class RoundRangeSliderTickMarkShape extends RangeSliderTickMarkShape {
2246
2273
assert (sliderTheme != null );
2247
2274
assert (sliderTheme.trackHeight != null );
2248
2275
assert (isEnabled != null );
2276
+ // ignore: deprecated_member_use_from_same_package
2249
2277
return Size .fromRadius (tickMarkRadius ?? sliderTheme.trackHeight / (useV2Slider ? 4 : 2 ));
2250
2278
}
2251
2279
@@ -2364,6 +2392,7 @@ class _EmptySliderComponentShape extends SliderComponentShape {
2364
2392
2365
2393
/// The default shape of a [Slider] 's thumb.
2366
2394
///
2395
+ // ignore: deprecated_member_use_from_same_package
2367
2396
/// If [useV2Slider] is true, then there is a shadow for the resting and
2368
2397
/// pressed state.
2369
2398
///
@@ -2379,7 +2408,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
2379
2408
this .disabledThumbRadius,
2380
2409
this .elevation = 1.0 ,
2381
2410
this .pressedElevation = 6.0 ,
2382
- this .useV2Slider = false ,
2411
+ this .useV2Slider = true ,
2383
2412
});
2384
2413
2385
2414
/// The preferred radius of the round thumb shape when the slider is enabled.
@@ -2396,6 +2425,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
2396
2425
2397
2426
/// The resting elevation adds shadow to the unpressed thumb.
2398
2427
///
2428
+ // ignore: deprecated_member_use_from_same_package
2399
2429
/// This value is only used when [useV2Slider] is true.
2400
2430
///
2401
2431
/// The default is 1.
@@ -2407,6 +2437,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
2407
2437
2408
2438
/// The pressed elevation adds shadow to the pressed thumb.
2409
2439
///
2440
+ // ignore: deprecated_member_use_from_same_package
2410
2441
/// This value is only used when [useV2Slider] is true.
2411
2442
///
2412
2443
/// The default is 6.
@@ -2416,6 +2447,10 @@ class RoundSliderThumbShape extends SliderComponentShape {
2416
2447
final double pressedElevation;
2417
2448
2418
2449
/// {@macro flutter.material.slider.useV2Slider}
2450
+ @Deprecated (
2451
+ 'This flag has changed to true by default and no longer needed. '
2452
+ 'This feature was deprecated after v1.18.0.'
2453
+ )
2419
2454
final bool useV2Slider;
2420
2455
2421
2456
@override
@@ -2459,6 +2494,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
2459
2494
final Color color = colorTween.evaluate (enableAnimation);
2460
2495
final double radius = radiusTween.evaluate (enableAnimation);
2461
2496
2497
+ // ignore: deprecated_member_use_from_same_package
2462
2498
if (useV2Slider) {
2463
2499
final Tween <double > elevationTween = Tween <double >(
2464
2500
begin: elevation,
@@ -2481,6 +2517,7 @@ class RoundSliderThumbShape extends SliderComponentShape {
2481
2517
2482
2518
/// The default shape of a [RangeSlider] 's thumbs.
2483
2519
///
2520
+ // ignore: deprecated_member_use_from_same_package
2484
2521
/// If [useV2Slider] is true, then there is a shadow for the resting and
2485
2522
/// pressed state.
2486
2523
///
@@ -2496,10 +2533,14 @@ class RoundRangeSliderThumbShape extends RangeSliderThumbShape {
2496
2533
this .disabledThumbRadius,
2497
2534
this .elevation = 1.0 ,
2498
2535
this .pressedElevation = 6.0 ,
2499
- this .useV2Slider = false ,
2536
+ this .useV2Slider = true ,
2500
2537
}) : assert (enabledThumbRadius != null );
2501
2538
2502
2539
/// {@macro flutter.material.slider.useV2Slider}
2540
+ @Deprecated (
2541
+ 'This flag has changed to true by default and no longer needed. '
2542
+ 'This feature was deprecated after v1.18.0.'
2543
+ )
2503
2544
final bool useV2Slider;
2504
2545
2505
2546
/// The preferred radius of the round thumb shape when the slider is enabled.
@@ -2595,6 +2636,7 @@ class RoundRangeSliderThumbShape extends RangeSliderThumbShape {
2595
2636
2596
2637
final Color color = colorTween.evaluate (enableAnimation);
2597
2638
2639
+ // ignore: deprecated_member_use_from_same_package
2598
2640
if (useV2Slider) {
2599
2641
final double evaluatedElevation = isPressed ? elevationTween.evaluate (activationAnimation) : elevation;
2600
2642
final Path shadowPath = Path ()
0 commit comments