paint abstract method

void paint(
  1. PaintingContext context,
  2. Offset center,
  3. {required RenderBox parentBox,
  4. required SliderThemeData sliderTheme,
  5. required Animation<double> enableAnimation,
  6. required Offset thumbCenter,
  7. required bool isEnabled,
  8. required TextDirection textDirection}
)

Paints the slider track.

The context argument is the same as the one that includes the Slider's render box.

The center argument is the offset for where this shape's center should be painted. This offset is relative to the origin of the context canvas.

The parentBox argument is the RenderBox of the Slider. Its attributes, such as size, can be used to assist in painting this shape.

the sliderTheme argument is the theme assigned to the Slider that this shape belongs to.

The enableAnimation argument is an animation triggered when the Slider is enabled, and it reverses when the slider is disabled. The Slider is enabled when Slider.onChanged is not null.Use this to paint intermediate frames for this shape when the slider changes enabled state.

The isEnabled argument is false when Slider.onChanged is null and true otherwise. When true, the slider will respond to input.

The textDirection argument can be used to determine how the tick marks are painting depending on whether they are on an active track segment or not. The track segment between the start of the slider and the thumb is the active track segment. The track segment between the thumb and the end of the slider is the inactive track segment. In LTR text direction, the start of the slider is on the left, and in RTL text direction, the start of the slider is on the right.

Implementation

void paint(
  PaintingContext context,
  Offset center, {
  required RenderBox parentBox,
  required SliderThemeData sliderTheme,
  required Animation<double> enableAnimation,
  required Offset thumbCenter,
  required bool isEnabled,
  required TextDirection textDirection,
});