paint method
- @override
override
Paints the shape, taking into account the state passed to it.
activationAnimation
is an animation triggered when the user beings
to interact with the slider. It reverses when the user stops interacting
with the slider.
enableAnimation
is an animation triggered when the Slider is enabled,
and it reverses when the slider is disabled.
value
is the current parametric value (from 0.0 to 1.0) of the slider.
If labelPainter
is non-null, then labelPainter.paint
should be
called with the location that the label should appear. If the labelPainter
passed is null, then no label was supplied to the Slider.
Implementation
@override
void paint(
PaintingContext context,
Offset thumbCenter, {
Animation<double> activationAnimation,
Animation<double> enableAnimation,
bool isDiscrete,
TextPainter labelPainter,
RenderBox parentBox,
SliderThemeData sliderTheme,
TextDirection textDirection,
double value,
}) {
final ColorTween enableColor = ColorTween(
begin: sliderTheme.disabledThumbColor,
end: sliderTheme.valueIndicatorColor,
);
_drawValueIndicator(
parentBox,
context.canvas,
thumbCenter,
Paint()..color = enableColor.evaluate(enableAnimation),
activationAnimation.value,
labelPainter,
);
}