[Material] Update the Slider and RangeSlider to the latest Material spec (#44351)
Update the Slider and RangeSlider to the latest Material spec. This introduces an updated track, updated thumbs, updated tick marks, and a new value indicator shape. The old paddle value indicator shape is also updated so that text scaling works consistently.
This commit is contained in:
@@ -69,6 +69,7 @@ class _CustomRangeThumbShape extends RangeSliderThumbShape {
|
||||
@required SliderThemeData sliderTheme,
|
||||
TextDirection textDirection,
|
||||
Thumb thumb,
|
||||
bool isPressed,
|
||||
}) {
|
||||
final Canvas canvas = context.canvas;
|
||||
final ColorTween colorTween = ColorTween(
|
||||
@@ -130,6 +131,8 @@ class _CustomThumbShape extends SliderComponentShape {
|
||||
SliderThemeData sliderTheme,
|
||||
TextDirection textDirection,
|
||||
double value,
|
||||
double textScaleFactor,
|
||||
Size sizeWithOverflow,
|
||||
}) {
|
||||
final Canvas canvas = context.canvas;
|
||||
final ColorTween colorTween = ColorTween(
|
||||
@@ -169,6 +172,8 @@ class _CustomValueIndicatorShape extends SliderComponentShape {
|
||||
SliderThemeData sliderTheme,
|
||||
TextDirection textDirection,
|
||||
double value,
|
||||
double textScaleFactor,
|
||||
Size sizeWithOverflow,
|
||||
}) {
|
||||
final Canvas canvas = context.canvas;
|
||||
final ColorTween enableColor = ColorTween(
|
||||
@@ -438,4 +443,3 @@ class _RangeSlidersState extends State<_RangeSliders> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ ThemeData _buildDarkTheme() {
|
||||
final ThemeData base = ThemeData(
|
||||
brightness: Brightness.dark,
|
||||
accentColorBrightness: Brightness.dark,
|
||||
colorScheme: colorScheme,
|
||||
primaryColor: primaryColor,
|
||||
primaryColorDark: const Color(0xFF0050a0),
|
||||
primaryColorLight: secondaryColor,
|
||||
|
||||
Reference in New Issue
Block a user