pub struct AlwaysScrollableScrollPhysics {
pub parent: Option<ScrollPhysicsRef>,
}Expand description
Scroll physics that always lets the user scroll.
This overrides the default behavior which is to disable scrolling when there is no content to scroll. It does not override the handling of overscrolling.
On Android, overscrolls will be clamped by default and result in an overscroll glow. On iOS, overscrolls will load a spring that will return the scroll view to its normal range when released.
See also:
ScrollPhysics, which can be used instead of this type when the default behavior is desired instead.BouncingScrollPhysics, which provides the bouncing overscroll behavior found on iOS.ClampingScrollPhysics, which provides the clamping overscroll behavior found on Android.
Fields§
§parent: Option<ScrollPhysicsRef>Implementations§
Source§impl AlwaysScrollableScrollPhysics
impl AlwaysScrollableScrollPhysics
Sourcepub fn new() -> AlwaysScrollableScrollPhysics
pub fn new() -> AlwaysScrollableScrollPhysics
Creates scroll physics that always lets the user scroll.
Sourcepub fn with_parent(
self,
parent: ScrollPhysicsRef,
) -> AlwaysScrollableScrollPhysics
pub fn with_parent( self, parent: ScrollPhysicsRef, ) -> AlwaysScrollableScrollPhysics
Dart AlwaysScrollableScrollPhysics(parent:).
Trait Implementations§
Source§impl ScrollPhysics for AlwaysScrollableScrollPhysics
impl ScrollPhysics for AlwaysScrollableScrollPhysics
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
The value behind the erased physics, for Dart’s
physics.runtimeType — which
ScrollableState._shouldUpdatePosition compares along the whole parent chain.Source§fn parent(&self) -> Option<&ScrollPhysicsRef>
fn parent(&self) -> Option<&ScrollPhysicsRef>
If non-null, determines the default behavior for each method. Read more
Source§fn apply_to(&self, ancestor: Option<ScrollPhysicsRef>) -> ScrollPhysicsRef
fn apply_to(&self, ancestor: Option<ScrollPhysicsRef>) -> ScrollPhysicsRef
Combines this
ScrollPhysics instance with the given physics. Read moreSource§fn should_accept_user_offset(&self, _position: &dyn ScrollMetrics) -> bool
fn should_accept_user_offset(&self, _position: &dyn ScrollMetrics) -> bool
Whether the scrollable should let the user adjust the scroll offset, for
example by dragging. If
allow_user_scrolling is
false, the scrollable will never allow user input to change the scroll position. Read moreSource§fn apply_physics_to_user_offset(
&self,
position: &dyn ScrollMetrics,
offset: f64,
) -> f64
fn apply_physics_to_user_offset( &self, position: &dyn ScrollMetrics, offset: f64, ) -> f64
Used by
DragScrollActivity and other user-driven activities to convert
an offset in logical pixels as provided by the DragUpdateDetails into a
delta to apply (subtract from the current position) using
ScrollActivityDelegate.setPixels. Read moreSource§fn allow_selection_edge_scrolling(&self) -> bool
fn allow_selection_edge_scrolling(&self) -> bool
Whether a viewport may scroll to reveal more content when a selection gesture extends
past the visible area, i.e. the viewport’s edge. Read more
Source§fn recommend_deferred_loading(
&self,
app: &mut App,
velocity: f64,
metrics: &dyn ScrollMetrics,
context: BuildContext,
) -> bool
fn recommend_deferred_loading( &self, app: &mut App, velocity: f64, metrics: &dyn ScrollMetrics, context: BuildContext, ) -> bool
Provides a heuristic to determine if expensive frame-bound tasks should be
deferred. Read more
Source§fn apply_boundary_conditions(
&self,
position: &dyn ScrollMetrics,
value: f64,
) -> f64
fn apply_boundary_conditions( &self, position: &dyn ScrollMetrics, value: f64, ) -> f64
Determines the overscroll by applying the boundary conditions. Read more
Source§fn adjust_position_for_new_dimensions(
&self,
old_position: &dyn ScrollMetrics,
new_position: &dyn ScrollMetrics,
is_scrolling: bool,
velocity: f64,
) -> f64
fn adjust_position_for_new_dimensions( &self, old_position: &dyn ScrollMetrics, new_position: &dyn ScrollMetrics, is_scrolling: bool, velocity: f64, ) -> f64
Describes what the scroll position should be given new viewport dimensions. Read more
Source§fn create_ballistic_simulation(
&self,
position: &dyn ScrollMetrics,
velocity: f64,
) -> Option<Box<dyn Simulation>>
fn create_ballistic_simulation( &self, position: &dyn ScrollMetrics, velocity: f64, ) -> Option<Box<dyn Simulation>>
Returns a simulation for ballistic scrolling starting from the given
position with the given velocity. Read more
Source§fn spring(&self) -> SpringDescription
fn spring(&self) -> SpringDescription
The spring to use for ballistic simulations.
Source§fn tolerance_for(&self, metrics: &dyn ScrollMetrics) -> Tolerance
fn tolerance_for(&self, metrics: &dyn ScrollMetrics) -> Tolerance
The tolerance to use for ballistic simulations.
Source§fn min_fling_distance(&self) -> f64
fn min_fling_distance(&self) -> f64
The minimum distance an input pointer drag must have moved to be
considered a scroll fling gesture. Read more
Source§fn min_fling_velocity(&self) -> f64
fn min_fling_velocity(&self) -> f64
The minimum velocity for an input pointer drag to be considered a
scroll fling. Read more
Source§fn max_fling_velocity(&self) -> f64
fn max_fling_velocity(&self) -> f64
Scroll fling velocity magnitudes will be clamped to this value.
Source§fn carried_momentum(&self, existing_velocity: f64) -> f64
fn carried_momentum(&self, existing_velocity: f64) -> f64
Returns the velocity carried on repeated flings. Read more
Source§fn drag_start_distance_motion_threshold(&self) -> Option<f64>
fn drag_start_distance_motion_threshold(&self) -> Option<f64>
The minimum amount of pixel distance drags must move by to start motion
the first time or after each time the drag motion stopped. Read more
Source§fn allow_implicit_scrolling(&self) -> bool
fn allow_implicit_scrolling(&self) -> bool
Whether a viewport is allowed to change its scroll position implicitly in
response to a call to
RenderObject.showOnScreen. Read moreSource§fn allow_user_scrolling(&self) -> bool
fn allow_user_scrolling(&self) -> bool
Whether a viewport is allowed to change the scroll position as the result of user
input.
Auto Trait Implementations§
impl !RefUnwindSafe for AlwaysScrollableScrollPhysics
impl !Send for AlwaysScrollableScrollPhysics
impl !Sync for AlwaysScrollableScrollPhysics
impl !UnwindSafe for AlwaysScrollableScrollPhysics
impl Forget for AlwaysScrollableScrollPhysics
impl Freeze for AlwaysScrollableScrollPhysicswhere
*const RcInner<dyn ScrollPhysics> is !null: Freeze,
PhantomData<RcInner<dyn ScrollPhysics>>: Freeze,
impl Move for AlwaysScrollableScrollPhysics
impl Unpin for AlwaysScrollableScrollPhysics
impl UnsafeUnpin for AlwaysScrollableScrollPhysicswhere
*const RcInner<dyn ScrollPhysics> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ScrollPhysics>>: 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