GappedRangeSliderTrackShape class

The GappedRangeSliderTrackShape consists of active and inactive tracks. The active track uses the SliderThemeData.activeTrackColor and the inactive tracks uses the SliderThemeData.inactiveTrackColor.

The track shape uses circular corner radius for the edge corners and a corner radius of 2 pixels for the inside corners.

Between the active and inactive tracks there are gaps of size SliderThemeData.trackGap. If the SliderThemeData.thumbShape is HandleRangeSliderThumbShape and the thumb is pressed, the thumb's width is reduced; as a result, the track gaps size in GappedRangeSliderTrackShape is also reduced.

If SliderThemeData.trackGap is null, then the track gaps size defaults to 6 pixels.

If ThemeData.useMaterial3 is true and RangeSlider.year2023 is false, then the RangeSlider will use GappedRangeSliderTrackShape as the default track shape.

See also:

  • RangeSlider, which includes a track defined by this shape.
  • SliderTheme, which can be used to configure the track shape of all range sliders in a widget subtree.
Inheritance
Mixed-in types

Constructors

GappedRangeSliderTrackShape.new()
Create a range slider track that draws 3 rounded rectangles with rounded outer edges.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isRounded bool
Whether the track shape is rounded. This is used to determine the correct position of the thumbs in relation to the track. Defaults to false.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 nonexistent method or property is accessed.
inherited
paint(PaintingContext context, Offset offset, {required RenderBox parentBox, required SliderThemeData sliderTheme, required Animation<double> enableAnimation, required Offset startThumbCenter, required Offset endThumbCenter, bool isEnabled = false, bool isDiscrete = false, required TextDirection textDirection, double additionalActiveTrackHeight = 2}) → 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