pub struct AnyScrollController { /* private fields */ }Expand description
Erased ScrollControllerLeaf: what a field or parameter Dart types as
ScrollController becomes.
Equality is Dart’s == on an object reference.
Implementations§
Source§impl AnyScrollController
impl AnyScrollController
Sourcepub fn upgrade(self, app: &App) -> Option<Retained<AnyScrollController>>
pub fn upgrade(self, app: &App) -> Option<Retained<AnyScrollController>>
A reference while something still keeps the object, None once it is freed or
its last keeper has let go; see Handle::upgrade.
Sourcepub fn keep(self, app: &App) -> Retained<AnyScrollController>
pub fn keep(self, app: &App) -> Retained<AnyScrollController>
A reference to an object something is known to keep; see
Handle::keep.
Source§impl AnyScrollController
impl AnyScrollController
Sourcepub fn identity_hash(self) -> u64
pub fn identity_hash(self) -> u64
The identity a dump shows, Dart’s describeIdentity(controller) without the description
its toString adds: a widget’s properties are filled without an App.
Sourcepub fn type_id(self) -> TypeId
pub fn type_id(self) -> TypeId
Dart’s controller.runtimeType, for the identity checks a Scrollable makes.
Sourcepub fn notification_listener(self) -> Listener
pub fn notification_listener(self) -> Listener
Sourcepub fn initial_scroll_offset(self, app: &App) -> f64
pub fn initial_scroll_offset(self, app: &App) -> f64
Sourcepub fn keep_scroll_offset(self, app: &App) -> bool
pub fn keep_scroll_offset(self, app: &App) -> bool
Each time a scroll completes, save the current scroll
offset with PageStorage and restore it if this controller’s
scrollable is recreated.
If this property is set to false, the scroll offset is never saved
and initial_scroll_offset is always used to initialize
the scroll offset. If true (the default), the initial scroll offset is used the
first time the controller’s scrollable is created, since there’s no
scroll offset to restore yet. Subsequently the saved offset is
restored and the initial scroll offset is ignored.
Sourcepub fn on_attach(self, app: &App) -> Option<ScrollControllerCallback>
pub fn on_attach(self, app: &App) -> Option<ScrollControllerCallback>
Called when a [ScrollPosition] is attached to the scroll controller.
Since a scroll position is not attached until a Scrollable is actually
built, this can be used to respond to a new position being attached.
Sourcepub fn on_detach(self, app: &App) -> Option<ScrollControllerCallback>
pub fn on_detach(self, app: &App) -> Option<ScrollControllerCallback>
Called when a [ScrollPosition] is detached from the scroll controller.
Sourcepub fn debug_label(self, app: &App) -> Option<String>
pub fn debug_label(self, app: &App) -> Option<String>
A label that is used in the to_string output. Intended to aid with
identifying scroll controller instances in debug output.
Sourcepub fn positions(self, app: &App) -> Vec<AnyScrollPosition>
pub fn positions(self, app: &App) -> Vec<AnyScrollPosition>
Sourcepub fn has_clients(self, app: &App) -> bool
pub fn has_clients(self, app: &App) -> bool
Whether any [ScrollPosition] objects have attached themselves to this
controller using the attach method.
If this is false, then members that interact with the [ScrollPosition],
such as position, offset,
animate_to, and jump_to, must not be called.
Sourcepub fn position(self, app: &App) -> AnyScrollPosition
pub fn position(self, app: &App) -> AnyScrollPosition
Returns the attached [ScrollPosition], from which the actual scroll offset
of the ScrollView can be obtained.
Calling this is only valid when only a single position is attached.
Sourcepub fn offset(self, app: &App) -> f64
pub fn offset(self, app: &App) -> f64
The current scroll offset of the scrollable widget.
Requires the controller to be controlling exactly one scrollable widget.
Sourcepub fn animate_to(
self,
app: &mut App,
offset: f64,
duration: Duration,
curve: Rc<dyn Curve>,
) -> CompleterFuture<()> ⓘ
pub fn animate_to( self, app: &mut App, offset: f64, duration: Duration, curve: Rc<dyn Curve>, ) -> CompleterFuture<()> ⓘ
Animates the position from its current value to the given value.
Any active animation is canceled. If the user is currently scrolling, that action is canceled.
An animation will be interrupted whenever the user attempts to scroll
manually, or whenever another activity is started, or whenever the
animation reaches the edge of the viewport and attempts to overscroll. (If
the [ScrollPosition] does not overscroll but instead allows scrolling
beyond the extents, then going beyond the extents will not interrupt the
animation.)
The animation is indifferent to changes to the viewport or content dimensions.
Once the animation has completed, the scroll position will attempt to begin a ballistic activity in case its value is not stable.
The duration must not be zero. To jump to a particular value without an
animation, use jump_to.
The returned future completes once every attached position’s animation has ended.
Sourcepub fn jump_to(self, app: &mut App, value: f64)
pub fn jump_to(self, app: &mut App, value: f64)
Jumps the scroll position from its current value to the given value, without animation, and without checking if the new value is in range.
Any active animation is canceled. If the user is currently scrolling, that action is canceled.
If this method changes the scroll position, a sequence of start/update/end scroll notifications will be dispatched. No overscroll notifications can be generated by this method.
Immediately after the jump, a ballistic activity is started, in case the value was out of range.
Sourcepub fn attach(self, app: &mut App, position: ScrollPositionRef)
pub fn attach(self, app: &mut App, position: ScrollPositionRef)
Sourcepub fn detach(self, app: &mut App, position: AnyScrollPosition)
pub fn detach(self, app: &mut App, position: AnyScrollPosition)
Sourcepub fn create_scroll_position(
self,
app: &mut App,
physics: ScrollPhysicsRef,
context: Rc<dyn ScrollContext>,
old_position: Option<AnyScrollPosition>,
) -> ScrollPositionRef
pub fn create_scroll_position( self, app: &mut App, physics: ScrollPhysicsRef, context: Rc<dyn ScrollContext>, old_position: Option<AnyScrollPosition>, ) -> ScrollPositionRef
Sourcepub fn debug_fill_description(self, app: &App, description: &mut Vec<String>)
pub fn debug_fill_description(self, app: &App, description: &mut Vec<String>)
Sourcepub fn to_string(self, app: &App) -> String
pub fn to_string(self, app: &App) -> String
Dart’s toString, which reads the arena and so cannot be std::fmt::Debug.
Trait Implementations§
Source§impl Clone for AnyScrollController
impl Clone for AnyScrollController
impl Copy for AnyScrollController
Source§impl Debug for AnyScrollController
impl Debug for AnyScrollController
impl Eq for AnyScrollController
Source§impl From<AnyScrollController> for HandleId
impl From<AnyScrollController> for HandleId
Source§fn from(handle: AnyScrollController) -> HandleId
fn from(handle: AnyScrollController) -> HandleId
Source§impl<Leaf: ScrollControllerLeaf> From<Handle<Leaf>> for AnyScrollController
impl<Leaf: ScrollControllerLeaf> From<Handle<Leaf>> for AnyScrollController
Source§fn from(handle: Handle<Leaf>) -> AnyScrollController
fn from(handle: Handle<Leaf>) -> AnyScrollController
Source§impl Hash for AnyScrollController
impl Hash for AnyScrollController
Source§impl Listenable for AnyScrollController
impl Listenable for AnyScrollController
Source§fn add_listener(&self, app: &mut App, listener: Listener)
fn add_listener(&self, app: &mut App, listener: Listener)
Source§fn remove_listener(&self, app: &mut App, listener: &Listener)
fn remove_listener(&self, app: &mut App, listener: &Listener)
Source§impl PartialEq for AnyScrollController
impl PartialEq for AnyScrollController
Auto Trait Implementations§
impl Forget for AnyScrollController
impl Freeze for AnyScrollController
impl Move for AnyScrollController
impl RefUnwindSafe for AnyScrollController
impl Send for AnyScrollController
impl Sync for AnyScrollController
impl Unpin for AnyScrollController
impl UnsafeUnpin for AnyScrollControllerwhere
NonZeroU32Inner: UnsafeUnpin,
&'static ScrollControllerVTable: UnsafeUnpin,
impl UnwindSafe for AnyScrollController
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.