pub struct GappedRangeSliderTrackShape;Expand description
The gapped shape of a RangeSlider’s track.
The GappedRangeSliderTrackShape consists of active and inactive
tracks. The active track uses the SliderThemeData::active_track_color and the
inactive tracks 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 are gaps of size
SliderThemeData::track_gap. If the SliderThemeData::thumb_shape 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::track_gap is null, then the track gaps size defaults to 6 pixels.
If ThemeData::use_material3 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.
Implementations§
Source§impl GappedRangeSliderTrackShape
impl GappedRangeSliderTrackShape
Sourcepub const fn new() -> GappedRangeSliderTrackShape
pub const fn new() -> GappedRangeSliderTrackShape
Create a range slider track that draws 3 rounded 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>,
start_thumb_center: Offset,
end_thumb_center: Offset,
is_enabled: bool,
is_discrete: bool,
text_direction: TextDirection,
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>, start_thumb_center: Offset, end_thumb_center: Offset, is_enabled: bool, is_discrete: bool, text_direction: TextDirection, additional_active_track_height: f64, )
Dart’s paint override with its extra additionalActiveTrackHeight (Dart’s
default 2), which a call through RangeSliderTrackShape cannot pass.
Trait Implementations§
Source§impl BaseRangeSliderTrackShape for GappedRangeSliderTrackShape
impl BaseRangeSliderTrackShape for GappedRangeSliderTrackShape
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§impl Clone for GappedRangeSliderTrackShape
impl Clone for GappedRangeSliderTrackShape
impl Copy for GappedRangeSliderTrackShape
Source§impl Debug for GappedRangeSliderTrackShape
impl Debug for GappedRangeSliderTrackShape
Source§impl RangeSliderTrackShape for GappedRangeSliderTrackShape
impl RangeSliderTrackShape for GappedRangeSliderTrackShape
Source§fn eq_shape(&self, other: &dyn RangeSliderTrackShape) -> bool
fn eq_shape(&self, other: &dyn RangeSliderTrackShape) -> bool
Value equality, as Dart’s canonicalized const instances are identical.