RectangularSliderTrackShape class Null safety

A Slider track that's a simple rectangle.

It paints a solid colored rectangle, vertically centered in the parentBox. The track rectangle extends to the bounds of the parentBox, but is padded by the RoundSliderOverlayShape radius. The height is defined by the SliderThemeData.trackHeight. The color is determined by the Slider's enabled state and the track segment's active state which are defined by: SliderThemeData.activeTrackColor, SliderThemeData.inactiveTrackColor, SliderThemeData.disabledActiveTrackColor, SliderThemeData.disabledInactiveTrackColor.

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 TextDirection.ltr, the start of the slider is on the left, and in TextDirection.rtl, the start of the slider is on the right.

![A slider widget, consisting of 5 divisions and showing the rectangular slider track shape.] (https://flutter.github.io/assets-for-api-docs/assets/material/rectangular_slider_track_shape.png)

See also:

Inheritance
Mixed in types

Constructors

RectangularSliderTrackShape({@Deprecated('It no longer has any effect because the thumb does not shrink when the slider is disabled now. ' 'This feature was deprecated after v1.26.0-18.0.pre.') double disabledThumbGapWidth})
Creates a slider track that draws 2 rectangles.
const

Properties

disabledThumbGapWidth double
Horizontal spacing, or gap, between the disabled thumb and the track. [...]
@Deprecated('It no longer has any effect because the thumb does not shrink when the slider is disabled now. ' 'This feature was deprecated after v1.26.0-18.0.pre.'), final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

getPreferredRect({required RenderBox parentBox, Offset offset = Offset.zero, required SliderThemeData sliderTheme, bool isEnabled = false, bool isDiscrete = false}) Rect
Returns a rect that represents the track bounds that fits within the Slider. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
paint(PaintingContext context, Offset offset, {required RenderBox parentBox, required SliderThemeData sliderTheme, required Animation<double> enableAnimation, required TextDirection textDirection, required Offset thumbCenter, bool isDiscrete = false, bool isEnabled = false}) → void
Paints the track shape based on the state passed to it. [...]
override
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited