pub struct SliderTheme {
pub key: Option<KeyRef>,
pub data: SliderThemeData,
pub child: WidgetRef,
}Expand description
Applies a slider theme to descendant Slider widgets.
A slider theme describes the colors and shape choices of the slider components.
Descendant widgets obtain the current theme’s SliderThemeData object using
SliderTheme::of. When a widget uses SliderTheme::of, it is automatically
rebuilt if the theme later changes.
The slider is as big as the largest of
the SliderComponentShape::get_preferred_size of the thumb shape,
the SliderComponentShape::get_preferred_size of the overlay shape,
and the SliderTickMarkShape::get_preferred_size of the tick mark shape.
See also:
SliderThemeData, which describes the actual configuration of a slider theme.SliderComponentShape, which can be used to create custom shapes for theSlider’s thumb, overlay, and value indicator and theRangeSlider’s overlay.SliderTrackShape, which can be used to create custom shapes for theSlider’s track.SliderTickMarkShape, which can be used to create custom shapes for theSlider’s tick marks.RangeSliderThumbShape, which can be used to create custom shapes for theRangeSlider’s thumb.RangeSliderValueIndicatorShape, which can be used to create custom shapes for theRangeSlider’s value indicator.RangeSliderTrackShape, which can be used to create custom shapes for theRangeSlider’s track.RangeSliderTickMarkShape, which can be used to create custom shapes for theRangeSlider’s tick marks.
Fields§
§key: Option<KeyRef>§data: SliderThemeDataSpecifies the color and shape values for descendant slider widgets.
child: WidgetRefImplementations§
Source§impl SliderTheme
impl SliderTheme
Sourcepub fn new<K>(data: SliderThemeData, child: impl IntoWidget<K>) -> SliderTheme
pub fn new<K>(data: SliderThemeData, child: impl IntoWidget<K>) -> SliderTheme
Applies the given theme data to child.
Sourcepub fn key(self, key: KeyRef) -> SliderTheme
pub fn key(self, key: KeyRef) -> SliderTheme
Dart SliderTheme(key:).
Sourcepub fn of(app: &mut App, context: BuildContext) -> SliderThemeData
pub fn of(app: &mut App, context: BuildContext) -> SliderThemeData
Returns the data from the closest SliderTheme instance that encloses
the given context.
Defaults to the ambient ThemeData::slider_theme if there is no
SliderTheme in the given build context.
SliderTheme::new(
SliderTheme::of(app, context).copy_with().active_track_color(Color::new(0xff804040)),
Slider::new(rocket_thrust, Some(on_changed)),
)See also:
SliderThemeData, which describes the actual configuration of a slider theme.
Trait Implementations§
Source§impl Debug for SliderTheme
impl Debug for SliderTheme
Source§impl InheritedTheme for SliderTheme
impl InheritedTheme for SliderTheme
Source§impl InheritedWidget for SliderTheme
impl InheritedWidget for SliderTheme
Source§fn update_should_notify(&self, old_widget: &SliderTheme) -> bool
fn update_should_notify(&self, old_widget: &SliderTheme) -> bool
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Auto Trait Implementations§
impl !RefUnwindSafe for SliderTheme
impl !Send for SliderTheme
impl !Sync for SliderTheme
impl !UnwindSafe for SliderTheme
impl Forget for SliderTheme
impl Freeze for SliderThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const RcInner<dyn SliderComponentShape> is !null: Freeze,
PhantomData<RcInner<dyn SliderComponentShape>>: Freeze,
*const RcInner<dyn SliderTickMarkShape> is !null: Freeze,
PhantomData<RcInner<dyn SliderTickMarkShape>>: Freeze,
*const RcInner<dyn SliderTrackShape> is !null: Freeze,
PhantomData<RcInner<dyn SliderTrackShape>>: Freeze,
*const RcInner<dyn RangeSliderTickMarkShape> is !null: Freeze,
PhantomData<RcInner<dyn RangeSliderTickMarkShape>>: Freeze,
*const RcInner<dyn RangeSliderThumbShape> is !null: Freeze,
PhantomData<RcInner<dyn RangeSliderThumbShape>>: Freeze,
*const RcInner<dyn RangeSliderTrackShape> is !null: Freeze,
PhantomData<RcInner<dyn RangeSliderTrackShape>>: Freeze,
*const RcInner<dyn RangeSliderValueIndicatorShape> is !null: Freeze,
PhantomData<RcInner<dyn RangeSliderValueIndicatorShape>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for SliderTheme
impl Unpin for SliderThemewhere
Rc<dyn Key>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
Rc<dyn SliderComponentShape>: Unpin,
Rc<dyn SliderTickMarkShape>: Unpin,
Rc<dyn SliderTrackShape>: Unpin,
Rc<dyn RangeSliderTickMarkShape>: Unpin,
Rc<dyn RangeSliderThumbShape>: Unpin,
Rc<dyn RangeSliderTrackShape>: Unpin,
Rc<dyn RangeSliderValueIndicatorShape>: Unpin,
*const u8 is !null: Unpin,
Rc<Paint>: Unpin,
Rc<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>: Unpin,
Rc<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>: Unpin,
Rc<dyn WidgetStateProperty<Option<Size>>>: Unpin,
Rc<dyn Widget>: Unpin,
impl UnsafeUnpin for SliderThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const RcInner<dyn SliderComponentShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliderComponentShape>>: UnsafeUnpin,
*const RcInner<dyn SliderTickMarkShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliderTickMarkShape>>: UnsafeUnpin,
*const RcInner<dyn SliderTrackShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliderTrackShape>>: UnsafeUnpin,
*const RcInner<dyn RangeSliderTickMarkShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn RangeSliderTickMarkShape>>: UnsafeUnpin,
*const RcInner<dyn RangeSliderThumbShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn RangeSliderThumbShape>>: UnsafeUnpin,
*const RcInner<dyn RangeSliderTrackShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn RangeSliderTrackShape>>: UnsafeUnpin,
*const RcInner<dyn RangeSliderValueIndicatorShape> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn RangeSliderValueIndicatorShape>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(TextDirection, RangeValues, f64, Size, Size, f64) -> Option<Thumb>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Size>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Size>>>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.