pub struct TrackingScrollController { /* private fields */ }Expand description
A ScrollController whose
initial_scroll_offset tracks its most
recently updated [ScrollPosition].
This type can be used to synchronize the scroll offset of two or more
lazily created scroll views that share a single TrackingScrollController.
It tracks the most recently updated scroll position and reports it as its
initial scroll offset.
Implementations§
Source§impl TrackingScrollController
impl TrackingScrollController
Sourcepub fn new(
app: &mut App,
initial_scroll_offset: f64,
keep_scroll_offset: bool,
debug_label: Option<String>,
on_attach: Option<ScrollControllerCallback>,
on_detach: Option<ScrollControllerCallback>,
) -> Ref<TrackingScrollController>
pub fn new( app: &mut App, initial_scroll_offset: f64, keep_scroll_offset: bool, debug_label: Option<String>, on_attach: Option<ScrollControllerCallback>, on_detach: Option<ScrollControllerCallback>, ) -> Ref<TrackingScrollController>
Creates a scroll controller that continually updates its
initial_scroll_offset to match the
last scroll notification it received.
Sourcepub fn default(app: &mut App) -> Ref<TrackingScrollController>
pub fn default(app: &mut App) -> Ref<TrackingScrollController>
A tracking controller with all of Dart’s defaults.
Sourcepub fn most_recently_updated_position(
self: Handle<Self>,
app: &App,
) -> Option<AnyScrollPosition>
pub fn most_recently_updated_position( self: Handle<Self>, app: &App, ) -> Option<AnyScrollPosition>
The last [ScrollPosition] to change. Returns None if there aren’t any
attached scroll positions, or there hasn’t been any scrolling yet, or the
last position to change has since been removed.
Trait Implementations§
Source§impl ChangeNotifier for TrackingScrollController
impl ChangeNotifier for TrackingScrollController
fn change_notifier_data(&self) -> &ChangeNotifierData
fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData
Source§fn will_add_listener(self: Handle<Self>, app: &mut App)
fn will_add_listener(self: Handle<Self>, app: &mut App)
addListener that
work before super.addListener go here.Source§fn did_remove_listener(self: Handle<Self>, app: &mut App)
fn did_remove_listener(self: Handle<Self>, app: &mut App)
removeListener that
work after super.removeListener go here.Source§impl ScrollControllerLeaf for TrackingScrollController
impl ScrollControllerLeaf for TrackingScrollController
Source§fn initial_scroll_offset(self: Handle<Self>, app: &App) -> f64
fn initial_scroll_offset(self: Handle<Self>, app: &App) -> f64
Returns the scroll offset of the
most_recently_updated_position
or, if that is None, the initial scroll offset provided to the constructor.
Source§fn scroll_controller_data(
self: Handle<Self>,
app: &App,
) -> &ScrollControllerData
fn scroll_controller_data( self: Handle<Self>, app: &App, ) -> &ScrollControllerData
ScrollController fields, held under the field scroll_controller
(scroll_controller_accessors!).Source§fn scroll_controller_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ScrollControllerData
fn scroll_controller_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ScrollControllerData
Source§fn attach(self: Handle<Self>, app: &mut App, position: ScrollPositionRef)
fn attach(self: Handle<Self>, app: &mut App, position: ScrollPositionRef)
Source§fn detach(self: Handle<Self>, app: &mut App, position: AnyScrollPosition)
fn detach(self: Handle<Self>, app: &mut App, position: AnyScrollPosition)
Source§fn create_scroll_position(
self: Handle<Self>,
app: &mut App,
physics: ScrollPhysicsRef,
context: Rc<dyn ScrollContext>,
old_position: Option<AnyScrollPosition>,
) -> ScrollPositionRef
fn create_scroll_position( self: Handle<Self>, app: &mut App, physics: ScrollPhysicsRef, context: Rc<dyn ScrollContext>, old_position: Option<AnyScrollPosition>, ) -> ScrollPositionRef
Source§fn notification_listener(self: Handle<Self>) -> Listener
fn notification_listener(self: Handle<Self>) -> Listener
notifyListeners tear-off: the listener this controller keeps on each attached
position.Source§fn forward_notification(self: Handle<Self>, app: &mut App)
fn forward_notification(self: Handle<Self>, app: &mut App)
notification_listener.Source§fn animate_to(
self: Handle<Self>,
app: &mut App,
offset: f64,
duration: Duration,
curve: Rc<dyn Curve>,
) -> CompleterFuture<()> ⓘ
fn animate_to( self: Handle<Self>, app: &mut App, offset: f64, duration: Duration, curve: Rc<dyn Curve>, ) -> CompleterFuture<()> ⓘ
Source§fn as_controller(self: Handle<Self>) -> AnyScrollController
fn as_controller(self: Handle<Self>) -> AnyScrollController
AnyScrollController — what to pass where a Dart API
takes a ScrollController.