Skip to main content

ScrollbarThemeData

Struct ScrollbarThemeData 

Source
pub struct ScrollbarThemeData {
    pub thumb_visibility: Option<WidgetStatePropertyRef<Option<bool>>>,
    pub thickness: Option<WidgetStatePropertyRef<Option<f64>>>,
    pub track_visibility: Option<WidgetStatePropertyRef<Option<bool>>>,
    pub interactive: Option<bool>,
    pub radius: Option<Radius>,
    pub thumb_color: Option<WidgetStatePropertyRef<Option<Color>>>,
    pub track_color: Option<WidgetStatePropertyRef<Option<Color>>>,
    pub track_border_color: Option<WidgetStatePropertyRef<Option<Color>>>,
    pub cross_axis_margin: Option<f64>,
    pub main_axis_margin: Option<f64>,
    pub min_thumb_length: Option<f64>,
}
Expand description

Defines default property values for descendant Scrollbar widgets.

Descendant widgets obtain the current ScrollbarThemeData object with ScrollbarTheme::of. Instances of ScrollbarThemeData can be customized with ScrollbarThemeData::copy_with.

Typically the ScrollbarThemeData of a ScrollbarTheme is specified as part of the overall Theme with ThemeData::scrollbar_theme.

All ScrollbarThemeData properties are None by default. When None, the Scrollbar computes its own default values, typically based on the overall theme’s ThemeData::color_scheme.

See also:

  • ThemeData, which describes the overall theme information for the application.

Fields§

§thumb_visibility: Option<WidgetStatePropertyRef<Option<bool>>>

Overrides the default value of Scrollbar::thumb_visibility in all descendant Scrollbar widgets.

§thickness: Option<WidgetStatePropertyRef<Option<f64>>>

Overrides the default value of Scrollbar::thickness in all descendant Scrollbar widgets.

Resolves in the following states:

  • WidgetState::Hovered on web and desktop platforms.
§track_visibility: Option<WidgetStatePropertyRef<Option<bool>>>

Overrides the default value of Scrollbar::track_visibility in all descendant Scrollbar widgets.

§interactive: Option<bool>

Overrides the default value of Scrollbar::interactive in all descendant Scrollbar widgets.

§radius: Option<Radius>

Overrides the default value of Scrollbar::radius in all descendant widgets.

§thumb_color: Option<WidgetStatePropertyRef<Option<Color>>>

Overrides the default Color of the Scrollbar thumb in all descendant Scrollbar widgets.

Resolves in the following states:

  • WidgetState::Dragged.
  • WidgetState::Hovered on web and desktop platforms.
§track_color: Option<WidgetStatePropertyRef<Option<Color>>>

Overrides the default Color of the Scrollbar track when track_visibility is true in all descendant Scrollbar widgets.

Resolves in the following states:

  • WidgetState::Hovered on web and desktop platforms.
§track_border_color: Option<WidgetStatePropertyRef<Option<Color>>>

Overrides the default Color of the Scrollbar track border when track_visibility is true in all descendant Scrollbar widgets.

Resolves in the following states:

  • WidgetState::Hovered on web and desktop platforms.
§cross_axis_margin: Option<f64>

Overrides the default value of the ScrollbarPainter::cross_axis_margin property in all descendant Scrollbar widgets.

See also:

  • ScrollbarPainter::cross_axis_margin, which sets the distance from the scrollbar’s side to the nearest edge in logical pixels.
§main_axis_margin: Option<f64>

Overrides the default value of the ScrollbarPainter::main_axis_margin property in all descendant Scrollbar widgets.

See also:

  • ScrollbarPainter::main_axis_margin, which sets the distance from the scrollbar’s start and end to the edge of the viewport in logical pixels.
§min_thumb_length: Option<f64>

Overrides the default value of the ScrollbarPainter::min_length property in all descendant Scrollbar widgets.

See also:

  • ScrollbarPainter::min_length, which sets the preferred smallest size the scrollbar can shrink to when the total scrollable extent is large, the current visible viewport is small, and the viewport is not overscrolled.

Implementations§

Source§

impl ScrollbarThemeData

Source

pub fn new() -> ScrollbarThemeData

Creates a theme that can be used for ThemeData::scrollbar_theme; Dart’s optional named arguments are the fluent setters.

Source

pub fn thumb_visibility( self, thumb_visibility: WidgetStatePropertyRef<Option<bool>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(thumbVisibility:).

Source

pub fn thickness( self, thickness: WidgetStatePropertyRef<Option<f64>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(thickness:).

Source

pub fn track_visibility( self, track_visibility: WidgetStatePropertyRef<Option<bool>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(trackVisibility:).

Source

pub fn radius(self, radius: Radius) -> ScrollbarThemeData

Dart ScrollbarThemeData(radius:).

Source

pub fn thumb_color( self, thumb_color: WidgetStatePropertyRef<Option<Color>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(thumbColor:).

Source

pub fn track_color( self, track_color: WidgetStatePropertyRef<Option<Color>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(trackColor:).

Source

pub fn track_border_color( self, track_border_color: WidgetStatePropertyRef<Option<Color>>, ) -> ScrollbarThemeData

Dart ScrollbarThemeData(trackBorderColor:).

Source

pub fn cross_axis_margin(self, cross_axis_margin: f64) -> ScrollbarThemeData

Dart ScrollbarThemeData(crossAxisMargin:).

Source

pub fn main_axis_margin(self, main_axis_margin: f64) -> ScrollbarThemeData

Dart ScrollbarThemeData(mainAxisMargin:).

Source

pub fn min_thumb_length(self, min_thumb_length: f64) -> ScrollbarThemeData

Dart ScrollbarThemeData(minThumbLength:).

Source

pub fn interactive(self, interactive: bool) -> ScrollbarThemeData

Dart ScrollbarThemeData(interactive:).

Source

pub fn copy_with(&self) -> ScrollbarThemeData

Creates a copy of this object with the given fields replaced with the new values.

Dart’s named arguments are the fluent setters on the copy (data.copy_with().interactive(false)).

Source

pub fn lerp( a: Option<&ScrollbarThemeData>, b: Option<&ScrollbarThemeData>, t: f64, ) -> ScrollbarThemeData

Linearly interpolate between two Scrollbar themes.

{@macro dart.ui.shadow.lerp}

Trait Implementations§

Source§

impl Clone for ScrollbarThemeData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ScrollbarThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ScrollbarThemeData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for ScrollbarThemeData

Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for ScrollbarThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ScrollbarThemeData

Source§

fn eq(&self, other: &ScrollbarThemeData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>