RectangularSliderTrackShape class

This is the default shape of a Slider's track.

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 piece's active state which are defined by: SliderThemeData.activeTrackColor, SliderThemeData.inactiveTrackColor, SliderThemeData.disabledActiveTrackColor, SliderThemeData.disabledInactiveTrackColor.

See also:

  • Slider for the component that this is meant to display this shape.
  • SliderThemeData where an instance of this class is set to inform the slider of the visual details of the its track.
  • SliderTrackShape Base component for creating other custom track shapes.
Inheritance

Constructors

RectangularSliderTrackShape({double disabledThumbGapWidth: 2.0 })
Create a slider track that draws 2 rectangles.
const

Properties

disabledThumbGapWidth double
Horizontal spacing, or gap, between the disabled thumb and the track. [...]
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({RenderBox parentBox, Offset offset: Offset.zero, SliderThemeData sliderTheme, bool isEnabled, bool isDiscrete }) Rect
Returns the preferred bounds of the shape. [...]
override
paint(PaintingContext context, Offset offset, { RenderBox parentBox, SliderThemeData sliderTheme, Animation<double> enableAnimation, TextDirection textDirection, Offset thumbCenter, bool isDiscrete, bool isEnabled }) → void
Paints the track shape based on the state passed to it. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

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