pub struct MaterialScrollBehavior;Expand description
Describes how Scrollable widgets behave for MaterialApps.
Setting a MaterialScrollBehavior will apply a
GlowingOverscrollIndicator to Scrollable descendants when executing on
TargetPlatform::Android and TargetPlatform::Fuchsia.
When using the desktop platform, if the Scrollable widget scrolls in the
Axis::Vertical, a Scrollbar is applied.
If the scroll direction is Axis::Horizontal scroll views are less
discoverable, so consider adding a Scrollbar in these cases, either directly
or through the build_scrollbar method.
ThemeData::use_material3 specifies the
overscroll indicator that is used on TargetPlatform::Android, which
defaults to true, resulting in a StretchingOverscrollIndicator. Setting
ThemeData::use_material3 to false will instead use a
GlowingOverscrollIndicator.
See also:
ScrollBehavior, the default scrolling behavior extended by this class.
Implementations§
Source§impl MaterialScrollBehavior
impl MaterialScrollBehavior
Sourcepub const fn new() -> MaterialScrollBehavior
pub const fn new() -> MaterialScrollBehavior
Creates a MaterialScrollBehavior that decorates Scrollables with
StretchingOverscrollIndicators and Scrollbars based on the current
platform and provided ScrollableDetails.
ThemeData::use_material3 specifies the
overscroll indicator that is used on TargetPlatform::Android, which
defaults to true, resulting in a StretchingOverscrollIndicator. Setting
ThemeData::use_material3 to false will instead use a
GlowingOverscrollIndicator.
Trait Implementations§
Source§impl Clone for MaterialScrollBehavior
impl Clone for MaterialScrollBehavior
impl Copy for MaterialScrollBehavior
Source§impl Debug for MaterialScrollBehavior
impl Debug for MaterialScrollBehavior
Source§impl Default for MaterialScrollBehavior
impl Default for MaterialScrollBehavior
Source§impl ScrollBehavior for MaterialScrollBehavior
impl ScrollBehavior for MaterialScrollBehavior
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
behavior.runtimeType and the
covariant oldDelegate a should_notify override casts.Source§fn get_platform(&self, app: &mut App, context: BuildContext) -> TargetPlatform
fn get_platform(&self, app: &mut App, context: BuildContext) -> TargetPlatform
Source§fn build_scrollbar(
&self,
app: &mut App,
context: BuildContext,
child: WidgetRef,
details: &ScrollableDetails,
) -> WidgetRef
fn build_scrollbar( &self, app: &mut App, context: BuildContext, child: WidgetRef, details: &ScrollableDetails, ) -> WidgetRef
RawScrollbar to the child widget on desktop platforms.Source§fn build_overscroll_indicator(
&self,
app: &mut App,
context: BuildContext,
child: WidgetRef,
details: &ScrollableDetails,
) -> WidgetRef
fn build_overscroll_indicator( &self, app: &mut App, context: BuildContext, child: WidgetRef, details: &ScrollableDetails, ) -> WidgetRef
GlowingOverscrollIndicator to the child widget on
TargetPlatform::Android and TargetPlatform::Fuchsia.Source§fn drag_devices(&self) -> HashSet<PointerDeviceKind>
fn drag_devices(&self) -> HashSet<PointerDeviceKind>
Source§fn get_multitouch_drag_strategy(
&self,
app: &mut App,
context: AnyElement,
) -> MultitouchDragStrategy
fn get_multitouch_drag_strategy( &self, app: &mut App, context: AnyElement, ) -> MultitouchDragStrategy
Source§fn pointer_axis_modifiers(&self) -> HashSet<LogicalKeyboardKey>
fn pointer_axis_modifiers(&self) -> HashSet<LogicalKeyboardKey>
LogicalKeyboardKeys that, when any or all are pressed in
combination with a PointerDeviceKind::Mouse pointer scroll event, will
flip the axes of the scroll input. Read moreSource§fn velocity_tracker_builder(
&self,
app: &mut App,
context: AnyElement,
) -> Rc<dyn Fn(&PointerEvent) -> Box<dyn AnyVelocityTracker>>
fn velocity_tracker_builder( &self, app: &mut App, context: AnyElement, ) -> Rc<dyn Fn(&PointerEvent) -> Box<dyn AnyVelocityTracker>>
Scrollables’ drag gesture recognizers, for estimating the velocity of a
drag gesture. Read moreSource§fn get_scroll_physics(
&self,
app: &mut App,
context: AnyElement,
) -> Rc<dyn ScrollPhysics>
fn get_scroll_physics( &self, app: &mut App, context: AnyElement, ) -> Rc<dyn ScrollPhysics>
get_platform. Read moreSource§fn should_notify(&self, old_delegate: &(dyn ScrollBehavior + 'static)) -> bool
fn should_notify(&self, old_delegate: &(dyn ScrollBehavior + 'static)) -> bool
ScrollConfiguration is rebuilt with a new
ScrollBehavior of the same runtime type. Read moreSource§fn get_keyboard_dismiss_behavior(
&self,
app: &mut App,
context: AnyElement,
) -> ScrollViewKeyboardDismissBehavior
fn get_keyboard_dismiss_behavior( &self, app: &mut App, context: AnyElement, ) -> ScrollViewKeyboardDismissBehavior
ScrollView widgets. Read more