paint method Null safety
- PaintingContext context,
- Offset center,
- {required RenderBox parentBox,
- required SliderThemeData sliderTheme,
- required Animation<
double> enableAnimation, - required Offset startThumbCenter,
- required Offset endThumbCenter,
- bool isEnabled,
- required TextDirection textDirection}
Paints the slider track.
The context
argument represents the RangeSlider'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 RangeSlider. Its
attributes, such as size, can be used to assist in painting this shape.
The sliderTheme
argument is the theme assigned to the RangeSlider that
this shape belongs to.
The enableAnimation
argument is an animation triggered when the
RangeSlider is enabled, and it reverses when the slider is disabled. The
RangeSlider is enabled when RangeSlider.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 RangeSlider.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 painted depending on whether they are on an active track segment or not.
The track segment between the two thumbs is the active track segment. The track segments between the thumb and each end of the slider are the inactive track segments. In TextDirection.ltr, the start of the slider is on the left, and in TextDirection.rtl, 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 startThumbCenter,
required Offset endThumbCenter,
bool isEnabled,
required TextDirection textDirection,
});