Unverified Commit cfe992d0 authored by Anthony's avatar Anthony Committed by GitHub

[Material] Custom track, tick mark, and overlay shape painters for Slider (#25008)

Create a slider shape for custom track, tick mark, and overlay painting, for the material slider.
parent d5d47f63
...@@ -30,7 +30,9 @@ class LoggingThumbShape extends SliderComponentShape { ...@@ -30,7 +30,9 @@ class LoggingThumbShape extends SliderComponentShape {
Offset thumbCenter, { Offset thumbCenter, {
Animation<double> activationAnimation, Animation<double> activationAnimation,
Animation<double> enableAnimation, Animation<double> enableAnimation,
bool isEnabled,
bool isDiscrete, bool isDiscrete,
bool onActiveTrack,
TextPainter labelPainter, TextPainter labelPainter,
RenderBox parentBox, RenderBox parentBox,
SliderThemeData sliderTheme, SliderThemeData sliderTheme,
...@@ -720,14 +722,15 @@ void main() { ...@@ -720,14 +722,15 @@ void main() {
expect( expect(
sliderBox, sliderBox,
paints paints
..rect(color: customColor1) ..rect(color: customColor1) // active track
..rect(color: customColor2) ..rect(color: customColor2) // inactive track
..circle(color: customColor1.withAlpha(0x29)) ..circle(color: customColor1.withAlpha(0x29)) // overlay
..circle(color: customColor2) ..circle(color: customColor2) // 1st tick mark
..circle(color: customColor2) ..circle(color: customColor2) // 2nd tick mark
..circle(color: customColor1) ..circle(color: customColor2) // 3rd tick mark
..path(color: customColor1) ..circle(color: customColor1) // 4th tick mark
..circle(color: customColor1), ..path(color: customColor1) // indicator
..circle(color: customColor1), // thumb
); );
await gesture.up(); await gesture.up();
}); });
...@@ -1025,6 +1028,7 @@ void main() { ...@@ -1025,6 +1028,7 @@ void main() {
expect( expect(
sliderBox, sliderBox,
paints paints
..circle(x: 17.0, y: 16.0, radius: 1.0)
..circle(x: 208.5, y: 16.0, radius: 1.0) ..circle(x: 208.5, y: 16.0, radius: 1.0)
..circle(x: 400.0, y: 16.0, radius: 1.0) ..circle(x: 400.0, y: 16.0, radius: 1.0)
..circle(x: 591.5, y: 16.0, radius: 1.0) ..circle(x: 591.5, y: 16.0, radius: 1.0)
...@@ -1077,6 +1081,7 @@ void main() { ...@@ -1077,6 +1081,7 @@ void main() {
..circle(x: 400.0, y: 16.0, radius: 16.0) ..circle(x: 400.0, y: 16.0, radius: 16.0)
..circle(x: 17.0, y: 16.0, radius: 1.0) ..circle(x: 17.0, y: 16.0, radius: 1.0)
..circle(x: 208.5, y: 16.0, radius: 1.0) ..circle(x: 208.5, y: 16.0, radius: 1.0)
..circle(x: 400.0, y: 16.0, radius: 1.0)
..circle(x: 591.5, y: 16.0, radius: 1.0) ..circle(x: 591.5, y: 16.0, radius: 1.0)
..circle(x: 783.0, y: 16.0, radius: 1.0) ..circle(x: 783.0, y: 16.0, radius: 1.0)
..circle(x: 400.0, y: 16.0, radius: 6.0), ..circle(x: 400.0, y: 16.0, radius: 6.0),
...@@ -1089,6 +1094,7 @@ void main() { ...@@ -1089,6 +1094,7 @@ void main() {
paints paints
..circle(x: 17.0, y: 16.0, radius: 1.0) ..circle(x: 17.0, y: 16.0, radius: 1.0)
..circle(x: 208.5, y: 16.0, radius: 1.0) ..circle(x: 208.5, y: 16.0, radius: 1.0)
..circle(x: 400.0, y: 16.0, radius: 1.0)
..circle(x: 591.5, y: 16.0, radius: 1.0) ..circle(x: 591.5, y: 16.0, radius: 1.0)
..circle(x: 783.0, y: 16.0, radius: 1.0) ..circle(x: 783.0, y: 16.0, radius: 1.0)
..circle(x: 400.0, y: 16.0, radius: 6.0), ..circle(x: 400.0, y: 16.0, radius: 6.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