pub struct RectangularSliderTrackShape;Expand description
A Slider track that’s a simple rectangle.
It paints a solid colored rectangle, vertically centered in the
parent_box. The track rectangle extends to the bounds of the parent_box,
but is padded by the RoundSliderOverlayShape radius. The height is defined
by the SliderThemeData::track_height. The color is determined by the
Slider’s enabled state and the track segment’s active state which are
defined by:
SliderThemeData::active_track_color,
SliderThemeData::inactive_track_color,
SliderThemeData::disabled_active_track_color,
SliderThemeData::disabled_inactive_track_color.
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.
See also:
Slider, for the component that 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, which can be used to create custom shapes for theSlider’s track.RoundedRectSliderTrackShape, for a similar track with rounded edges.
Implementations§
Source§impl RectangularSliderTrackShape
impl RectangularSliderTrackShape
Sourcepub const fn new() -> RectangularSliderTrackShape
pub const fn new() -> RectangularSliderTrackShape
Creates a slider track that draws 2 rectangles.
Trait Implementations§
Source§impl BaseSliderTrackShape for RectangularSliderTrackShape
impl BaseSliderTrackShape for RectangularSliderTrackShape
Source§fn get_preferred_rect(
&self,
app: &App,
parent_box: AnyRenderBox,
offset: Offset,
slider_theme: &SliderThemeData,
is_enabled: Option<bool>,
is_discrete: Option<bool>,
) -> Rect
fn get_preferred_rect( &self, app: &App, parent_box: AnyRenderBox, offset: Offset, slider_theme: &SliderThemeData, is_enabled: Option<bool>, is_discrete: Option<bool>, ) -> Rect
Slider. Read moreSource§fn is_rounded(&self) -> bool
fn is_rounded(&self) -> bool
Source§impl Clone for RectangularSliderTrackShape
impl Clone for RectangularSliderTrackShape
impl Copy for RectangularSliderTrackShape
Source§impl Debug for RectangularSliderTrackShape
impl Debug for RectangularSliderTrackShape
Source§impl SliderTrackShape for RectangularSliderTrackShape
impl SliderTrackShape for RectangularSliderTrackShape
Source§fn eq_shape(&self, other: &dyn SliderTrackShape) -> bool
fn eq_shape(&self, other: &dyn SliderTrackShape) -> bool
Value equality, as Dart’s canonicalized const instances are identical.