@@ -227,8 +227,9 @@ mixin BaseSliderTrackShape {
227
227
bool isDiscrete = false ,
228
228
}) {
229
229
final double thumbWidth = sliderTheme.thumbShape! .getPreferredSize (isEnabled, isDiscrete).width;
230
- final double overlayWidth =
231
- sliderTheme.overlayShape! .getPreferredSize (isEnabled, isDiscrete).width;
230
+ final double overlayWidth = sliderTheme.overlayShape!
231
+ .getPreferredSize (isEnabled, isDiscrete)
232
+ .width;
232
233
double trackHeight = sliderTheme.trackHeight! ;
233
234
assert (overlayWidth >= 0 );
234
235
assert (trackHeight >= 0 );
@@ -372,8 +373,8 @@ class RectangularSliderTrackShape extends SliderTrackShape with BaseSliderTrackS
372
373
begin: sliderTheme.disabledSecondaryActiveTrackColor,
373
374
end: sliderTheme.secondaryActiveTrackColor,
374
375
);
375
- final Paint secondaryTrackPaint =
376
- Paint () ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
376
+ final Paint secondaryTrackPaint = Paint ()
377
+ ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
377
378
final Rect secondaryTrackSegment = switch (textDirection) {
378
379
TextDirection .rtl => Rect .fromLTRB (
379
380
secondaryOffset.dx,
@@ -520,8 +521,8 @@ class RoundedRectSliderTrackShape extends SliderTrackShape with BaseSliderTrackS
520
521
begin: sliderTheme.disabledSecondaryActiveTrackColor,
521
522
end: sliderTheme.secondaryActiveTrackColor,
522
523
);
523
- final Paint secondaryTrackPaint =
524
- Paint () ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
524
+ final Paint secondaryTrackPaint = Paint ()
525
+ ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
525
526
if (isLTR) {
526
527
context.canvas.drawRRect (
527
528
RRect .fromLTRBAndCorners (
@@ -624,8 +625,8 @@ class RoundSliderTickMarkShape extends SliderTickMarkShape {
624
625
sliderTheme.activeTickMarkColor,
625
626
),
626
627
};
627
- final Paint paint =
628
- Paint () ..color = ColorTween (begin: begin, end: end).evaluate (enableAnimation)! ;
628
+ final Paint paint = Paint ()
629
+ ..color = ColorTween (begin: begin, end: end).evaluate (enableAnimation)! ;
629
630
630
631
// The tick marks are tiny circles that are the same height as the track.
631
632
final double tickMarkRadius =
@@ -752,12 +753,12 @@ class RoundSliderThumbShape extends SliderComponentShape {
752
753
final Tween <double > elevationTween = Tween <double >(begin: elevation, end: pressedElevation);
753
754
754
755
final double evaluatedElevation = elevationTween.evaluate (activationAnimation);
755
- final Path path =
756
- Path () ..addArc (
757
- Rect .fromCenter (center: center, width: 2 * radius, height: 2 * radius),
758
- 0 ,
759
- math.pi * 2 ,
760
- );
756
+ final Path path = Path ()
757
+ ..addArc (
758
+ Rect .fromCenter (center: center, width: 2 * radius, height: 2 * radius),
759
+ 0 ,
760
+ math.pi * 2 ,
761
+ );
761
762
762
763
bool paintShadows = true ;
763
764
assert (() {
@@ -1021,11 +1022,10 @@ class _DropSliderValueIndicatorPathPainter {
1021
1022
final RRect borderRect = adjustedBorderRadius
1022
1023
.resolve (labelPainter.textDirection)
1023
1024
.toRRect (upperRect);
1024
- final Path trianglePath =
1025
- Path ()
1026
- ..lineTo (- _triangleHeight, - _triangleHeight)
1027
- ..lineTo (_triangleHeight, - _triangleHeight)
1028
- ..close ();
1025
+ final Path trianglePath = Path ()
1026
+ ..lineTo (- _triangleHeight, - _triangleHeight)
1027
+ ..lineTo (_triangleHeight, - _triangleHeight)
1028
+ ..close ();
1029
1029
trianglePath.addRRect (borderRect);
1030
1030
final Path path;
1031
1031
if (hasMultipleLines) {
@@ -1090,20 +1090,18 @@ class _DropSliderValueIndicatorPathPainter {
1090
1090
final RRect borderRect = adjustedBorderRadius
1091
1091
.resolve (labelPainter.textDirection)
1092
1092
.toRRect (upperRect);
1093
- path =
1094
- Path ()
1095
- ..lineTo (- _triangleHeight, - _triangleHeight)
1096
- ..lineTo (_triangleHeight, - _triangleHeight)
1097
- ..close ();
1093
+ path = Path ()
1094
+ ..lineTo (- _triangleHeight, - _triangleHeight)
1095
+ ..lineTo (_triangleHeight, - _triangleHeight)
1096
+ ..close ();
1098
1097
path.addRRect (borderRect);
1099
1098
}
1100
1099
1101
1100
if (strokePaintColor != null ) {
1102
- final Paint strokePaint =
1103
- Paint ()
1104
- ..color = strokePaintColor
1105
- ..strokeWidth = 1.0
1106
- ..style = PaintingStyle .stroke;
1101
+ final Paint strokePaint = Paint ()
1102
+ ..color = strokePaintColor
1103
+ ..strokeWidth = 1.0
1104
+ ..style = PaintingStyle .stroke;
1107
1105
canvas.drawPath (trianglePath, strokePaint);
1108
1106
canvas.drawPath (path, strokePaint);
1109
1107
}
@@ -1193,8 +1191,9 @@ class HandleThumbShape extends SliderComponentShape {
1193
1191
final Color color = colorTween.evaluate (enableAnimation)! ;
1194
1192
1195
1193
final Canvas canvas = context.canvas;
1196
- final Size thumbSize =
1197
- sliderTheme.thumbSize! .resolve (< MaterialState > {})! ; // This is resolved in the paint method.
1194
+ final Size thumbSize = sliderTheme.thumbSize! .resolve (
1195
+ < MaterialState > {},
1196
+ )! ; // This is resolved in the paint method.
1198
1197
final RRect rrect = RRect .fromRectAndRadius (
1199
1198
Rect .fromCenter (center: center, width: thumbSize.width, height: thumbSize.height),
1200
1199
Radius .circular (thumbSize.shortestSide / 2 ),
@@ -1352,8 +1351,8 @@ class GappedSliderTrackShape extends SliderTrackShape with BaseSliderTrackShape
1352
1351
begin: sliderTheme.disabledSecondaryActiveTrackColor,
1353
1352
end: sliderTheme.secondaryActiveTrackColor,
1354
1353
);
1355
- final Paint secondaryTrackPaint =
1356
- Paint () ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
1354
+ final Paint secondaryTrackPaint = Paint ()
1355
+ ..color = secondaryTrackColorTween.evaluate (enableAnimation)! ;
1357
1356
if (isLTR) {
1358
1357
context.canvas.drawRRect (
1359
1358
RRect .fromLTRBAndCorners (
@@ -1395,10 +1394,9 @@ class GappedSliderTrackShape extends SliderTrackShape with BaseSliderTrackShape
1395
1394
trackRect.center.dy,
1396
1395
);
1397
1396
1398
- final bool showStopIndicator =
1399
- (textDirection == TextDirection .ltr)
1400
- ? thumbCenter.dx < stopIndicatorOffset.dx
1401
- : thumbCenter.dx > stopIndicatorOffset.dx;
1397
+ final bool showStopIndicator = (textDirection == TextDirection .ltr)
1398
+ ? thumbCenter.dx < stopIndicatorOffset.dx
1399
+ : thumbCenter.dx > stopIndicatorOffset.dx;
1402
1400
if (showStopIndicator && ! isDiscrete) {
1403
1401
final Rect stopIndicatorRect = Rect .fromCircle (
1404
1402
center: stopIndicatorOffset,
@@ -1616,13 +1614,9 @@ class _RoundedRectSliderValueIndicatorPathPainter {
1616
1614
1617
1615
final bool hasMultipleLines = multilineConfig.enabled && labelText.contains ('\n ' );
1618
1616
final double cornerPadding = multilineConfig.cornerPadding ?? _multilineCornerPadding;
1619
- final double rectHeight =
1620
- hasMultipleLines
1621
- ? math.max (
1622
- _preferredHeight,
1623
- finalLabelPainter.height + (_labelPadding * 2 ) + cornerPadding,
1624
- )
1625
- : _preferredHeight * textScaleFactor;
1617
+ final double rectHeight = hasMultipleLines
1618
+ ? math.max (_preferredHeight, finalLabelPainter.height + (_labelPadding * 2 ) + cornerPadding)
1619
+ : _preferredHeight * textScaleFactor;
1626
1620
1627
1621
// The rectangle which is above the thumb, with no triangle)
1628
1622
final Rect upperRect = Rect .fromLTWH (
@@ -1643,11 +1637,10 @@ class _RoundedRectSliderValueIndicatorPathPainter {
1643
1637
canvas.drawRRect (rrect, fillPaint);
1644
1638
1645
1639
if (strokePaintColor != null ) {
1646
- final Paint strokePaint =
1647
- Paint ()
1648
- ..color = strokePaintColor
1649
- ..strokeWidth = 1.0
1650
- ..style = PaintingStyle .stroke;
1640
+ final Paint strokePaint = Paint ()
1641
+ ..color = strokePaintColor
1642
+ ..strokeWidth = 1.0
1643
+ ..style = PaintingStyle .stroke;
1651
1644
canvas.drawRRect (rrect, strokePaint);
1652
1645
}
1653
1646
0 commit comments