Skip to main content

RawScrollbarData

Struct RawScrollbarData 

Source
pub struct RawScrollbarData {
Show 23 fields pub key: Option<KeyRef>, pub child: WidgetRef, pub controller: Option<ScrollControllerRef>, pub thumb_visibility: Option<bool>, pub shape: Option<OutlinedBorderRef>, pub radius: Option<Radius>, pub thickness: Option<f64>, pub thumb_color: Option<Color>, pub min_thumb_length: f64, pub min_overscroll_length: Option<f64>, pub track_visibility: Option<bool>, pub track_radius: Option<Radius>, pub track_color: Option<Color>, pub track_border_color: Option<Color>, pub fade_duration: Duration, pub time_to_fade: Duration, pub press_duration: Duration, pub notification_predicate: ScrollNotificationPredicate, pub interactive: Option<bool>, pub scrollbar_orientation: Option<ScrollbarOrientation>, pub main_axis_margin: f64, pub cross_axis_margin: f64, pub padding: Option<EdgeInsetsGeometry>,
}
Expand description

The fields of Dart’s RawScrollbar, which its subclasses carry.

Fields§

§key: Option<KeyRef>§child: WidgetRef

The widget below this widget in the tree.

The scrollbar will be stacked on top of this child. This child (and its subtree) should include a source of ScrollNotification notifications.

§controller: Option<ScrollControllerRef>

The scroll controller used to implement scrollbar dragging.

If nothing is passed, the default behavior is to automatically enable scrollbar dragging on the nearest scroll controller using PrimaryScrollController::of.

§thumb_visibility: Option<bool>

Indicates that the scrollbar thumb should be visible, even when a scroll is not underway.

When false, the scrollbar will be shown during scrolling and will fade out otherwise. When true, the scrollbar will always be visible and never fade out. This requires that the scrollbar can access the scroll controller of the associated scrollable widget.

Defaults to false when None.

§shape: Option<OutlinedBorderRef>

The OutlinedBorder of the scrollbar’s thumb.

Only one of radius and this may be specified.

§radius: Option<Radius>

The Radius of the scrollbar thumb’s rounded rectangle corners.

The scrollbar will be rectangular if this is None, which is the default behavior.

§thickness: Option<f64>

The thickness of the scrollbar in the cross axis of the scrollable.

If None, defaults to 6.0 pixels.

§thumb_color: Option<Color>

The color of the scrollbar thumb.

If None, defaults to Color(0x66BCBCBC).

§min_thumb_length: f64

The preferred smallest size the scrollbar thumb can shrink to when the total scrollable extent is large, the current visible viewport is small, and the viewport is not overscrolled.

Defaults to 18.0.

§min_overscroll_length: Option<f64>

The preferred smallest size the scrollbar thumb can shrink to when the viewport is overscrolled.

When None, it defaults to the value of min_thumb_length.

§track_visibility: Option<bool>

Indicates that the scrollbar track should be visible.

When true, the scrollbar track will always be visible so long as the thumb is visible. If the scrollbar thumb is not visible, the track will not be visible either.

Defaults to false when None.

§track_radius: Option<Radius>

The Radius of the scrollbar track’s rounded rectangle corners.

§track_color: Option<Color>

The color of the scrollbar track.

If None, defaults to Color(0x08000000).

§track_border_color: Option<Color>

The color of the scrollbar track’s border.

If None, defaults to Color(0x1a000000).

§fade_duration: Duration

The Duration of the fade animation.

Defaults to 300 milliseconds.

§time_to_fade: Duration

The Duration of time until the fade animation begins.

Defaults to 600 milliseconds.

§press_duration: Duration

The Duration of time that a long press will trigger the drag gesture of the scrollbar thumb.

Defaults to Duration::ZERO.

§notification_predicate: ScrollNotificationPredicate

A check that specifies whether a ScrollNotification should be handled by this widget.

By default, checks whether notification.depth() == 0. That means if the scrollbar is wrapped around multiple scroll views, it only responds to the nearest one and shows the corresponding scrollbar thumb.

§interactive: Option<bool>

Whether the scrollbar should be interactive and respond to dragging on the thumb, or tapping in the track area.

When false, the scrollbar will not respond to gesture or hover events, and will allow to click through it.

Defaults to true when None.

§scrollbar_orientation: Option<ScrollbarOrientation>

Dictates the orientation of the scrollbar.

§main_axis_margin: f64

Distance from the scrollbar thumb’s start or end to the nearest edge of the viewport in logical pixels. It affects the amount of available paint area.

Defaults to 0.

§cross_axis_margin: f64

Distance from the scrollbar thumb’s side to the nearest cross axis edge in logical pixels.

Defaults to zero.

§padding: Option<EdgeInsetsGeometry>

The insets by which the scrollbar thumb and track should be padded.

When None, the inherited MediaQueryData.padding is used.

Implementations§

Source§

impl RawScrollbarData

Source

pub fn new(child: WidgetRef) -> RawScrollbarData

Dart’s RawScrollbar constructor defaults.

Trait Implementations§

Source§

impl Debug for RawScrollbarData

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for RawScrollbarData

§

impl !Send for RawScrollbarData

§

impl !Sync for RawScrollbarData

§

impl !UnwindSafe for RawScrollbarData

§

impl Forget for RawScrollbarData

§

impl Freeze for RawScrollbarData
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, NonZero<u32>: Freeze, &'static ScrollControllerVTable: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const RcInner<dyn OutlinedBorder> is !null: Freeze, PhantomData<RcInner<dyn OutlinedBorder>>: Freeze, *const RcInner<dyn Fn(&(dyn ScrollNotification + 'static)) -> bool> is !null: Freeze, PhantomData<RcInner<dyn Fn(&(dyn ScrollNotification + 'static)) -> bool>>: Freeze,

§

impl Move for RawScrollbarData

§

impl Unpin for RawScrollbarData
where Rc<dyn Key>: Unpin, Rc<dyn Widget>: Unpin, NonZero<u32>: Unpin, &'static ScrollControllerVTable: Unpin, Rc<Keep>: Unpin, Rc<dyn OutlinedBorder>: Unpin, Rc<dyn Fn(&(dyn ScrollNotification + 'static)) -> bool>: Unpin,

§

impl UnsafeUnpin for RawScrollbarData
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, &'static ScrollControllerVTable: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const RcInner<dyn OutlinedBorder> is !null: UnsafeUnpin, PhantomData<RcInner<dyn OutlinedBorder>>: UnsafeUnpin, *const RcInner<dyn Fn(&(dyn ScrollNotification + 'static)) -> bool> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&(dyn ScrollNotification + 'static)) -> bool>>: UnsafeUnpin,

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> 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, 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>