pub struct ScrollbarTheme {
pub key: Option<KeyRef>,
pub data: ScrollbarThemeData,
pub child: WidgetRef,
}Expand description
Applies a scrollbar theme to descendant Scrollbar widgets.
Descendant widgets obtain the current theme’s ScrollbarThemeData using
ScrollbarTheme::of. When a widget uses ScrollbarTheme::of, it is
automatically rebuilt if the theme later changes.
A scrollbar theme can be specified as part of the overall Material theme
using ThemeData::scrollbar_theme.
See also:
ScrollbarThemeData, which describes the configuration of a scrollbar theme.
Fields§
§key: Option<KeyRef>§data: ScrollbarThemeDataThe properties used for all descendant Scrollbar widgets.
child: WidgetRefImplementations§
Source§impl ScrollbarTheme
impl ScrollbarTheme
Sourcepub fn new<K>(
data: ScrollbarThemeData,
child: impl IntoWidget<K>,
) -> ScrollbarTheme
pub fn new<K>( data: ScrollbarThemeData, child: impl IntoWidget<K>, ) -> ScrollbarTheme
Constructs a scrollbar theme that configures all descendant Scrollbar
widgets.
Sourcepub fn key(self, key: KeyRef) -> ScrollbarTheme
pub fn key(self, key: KeyRef) -> ScrollbarTheme
Dart ScrollbarTheme(key:).
Sourcepub fn of(app: &mut App, context: BuildContext) -> ScrollbarThemeData
pub fn of(app: &mut App, context: BuildContext) -> ScrollbarThemeData
Returns the configuration data from the closest ScrollbarTheme
ancestor. If there is no ancestor, it returns ThemeData::scrollbar_theme.
Typical usage is as follows:
let theme = ScrollbarTheme::of(app, context);Trait Implementations§
Source§impl Debug for ScrollbarTheme
impl Debug for ScrollbarTheme
Source§impl InheritedTheme for ScrollbarTheme
impl InheritedTheme for ScrollbarTheme
Source§impl InheritedWidget for ScrollbarTheme
impl InheritedWidget for ScrollbarTheme
Source§fn update_should_notify(&self, old_widget: &ScrollbarTheme) -> bool
fn update_should_notify(&self, old_widget: &ScrollbarTheme) -> bool
Whether the framework should notify widgets that inherit from this widget. Read more
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
Dart’s
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, )
Dart’s
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 ScrollbarTheme
impl !Send for ScrollbarTheme
impl !Sync for ScrollbarTheme
impl !UnwindSafe for ScrollbarTheme
impl Forget for ScrollbarTheme
impl Freeze for ScrollbarThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<bool>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<bool>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for ScrollbarTheme
impl Unpin for ScrollbarTheme
impl UnsafeUnpin for ScrollbarThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<bool>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<bool>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<f64>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<f64>>>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: 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
Mutably borrows from an owned value. Read more
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>
The widget as a tree node, made where this is called: its
creation_location.