pub struct GappedSliderTrackShape;Expand description
The gapped shape of a Slider’s track.
The GappedSliderTrackShape consists of active and inactive
tracks. The active track uses the SliderThemeData::active_track_color and the
inactive track uses the SliderThemeData::inactive_track_color.
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 is a gap of size
SliderThemeData::track_gap. If the SliderThemeData::thumb_shape is
HandleThumbShape and the thumb is pressed, the thumb’s width is reduced; as a result,
the track gap size in GappedSliderTrackShape is also reduced.
If SliderThemeData::track_gap is null, then the track gap size defaults to 6 pixels.
This is the default track shape for Slider. If ThemeData::use_material3 is false,
then the default track shape is RoundedRectSliderTrackShape.
See also:
Slider, which includes an overlay defined by this shape.SliderTheme, which can be used to configure the overlay shape of all sliders in a widget subtree.
Implementations§
Source§impl GappedSliderTrackShape
impl GappedSliderTrackShape
Sourcepub const fn new() -> GappedSliderTrackShape
pub const fn new() -> GappedSliderTrackShape
Create a slider track that draws two rectangles with rounded outer edges.
Sourcepub fn paint(
&self,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
parent_box: AnyRenderBox,
slider_theme: &SliderThemeData,
enable_animation: AnyAnimation<f64>,
text_direction: TextDirection,
thumb_center: Offset,
secondary_offset: Option<Offset>,
is_discrete: bool,
is_enabled: bool,
_additional_active_track_height: f64,
)
pub fn paint( &self, app: &mut App, context: &mut PaintingContext, offset: Offset, parent_box: AnyRenderBox, slider_theme: &SliderThemeData, enable_animation: AnyAnimation<f64>, text_direction: TextDirection, thumb_center: Offset, secondary_offset: Option<Offset>, is_discrete: bool, is_enabled: bool, _additional_active_track_height: f64, )
Dart’s paint with its extra additionalActiveTrackHeight argument, which the
SliderTrackShape::paint override passes as Dart’s default, 2.
Trait Implementations§
Source§impl BaseSliderTrackShape for GappedSliderTrackShape
impl BaseSliderTrackShape for GappedSliderTrackShape
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 GappedSliderTrackShape
impl Clone for GappedSliderTrackShape
impl Copy for GappedSliderTrackShape
Source§impl Debug for GappedSliderTrackShape
impl Debug for GappedSliderTrackShape
Source§impl Default for GappedSliderTrackShape
impl Default for GappedSliderTrackShape
Source§impl PartialEq for GappedSliderTrackShape
impl PartialEq for GappedSliderTrackShape
Source§impl SliderTrackShape for GappedSliderTrackShape
impl SliderTrackShape for GappedSliderTrackShape
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.