pub struct ScrollableState { /* private fields */ }Expand description
State object for a Scrollable widget.
To manipulate a Scrollable widget’s scroll position, use the object
obtained from the position property.
To be informed of when a Scrollable widget is scrolling, use a
NotificationListener to listen for crate::ScrollNotification notifications.
Implementations§
Source§impl ScrollableState
impl ScrollableState
Sourcepub fn position(self: Handle<Self>, app: &App) -> AnyScrollPosition
pub fn position(self: Handle<Self>, app: &App) -> AnyScrollPosition
The manager for this Scrollable widget’s viewport position.
To control what kind of ScrollPosition is created for a Scrollable,
provide it with a custom ScrollController that creates the appropriate
ScrollPosition in its
create_scroll_position method.
Sourcepub fn resolved_physics(
self: Handle<Self>,
app: &App,
) -> Option<ScrollPhysicsRef>
pub fn resolved_physics( self: Handle<Self>, app: &App, ) -> Option<ScrollPhysicsRef>
The resolved ScrollPhysics of the ScrollableState.
Sourcepub fn delta_to_scroll_origin(self: Handle<Self>, app: &App) -> Offset
pub fn delta_to_scroll_origin(self: Handle<Self>, app: &App) -> Offset
An Offset that represents the absolute distance from the origin, or 0,
of the ScrollPosition expressed in the associated Axis.
Used by an auto scroller to progress the position forward when a drag gesture reaches the edge of the viewport.
Sourcepub fn kept_position(self: Handle<Self>, app: &App) -> ScrollPositionRef
pub fn kept_position(self: Handle<Self>, app: &App) -> ScrollPositionRef
The position as a reference, for a caller that keeps it: a field
Dart types as the ScrollPosition it reads from a ScrollableState.
Trait Implementations§
Source§impl Debug for ScrollableState
impl Debug for ScrollableState
Source§impl RestorationMixin for ScrollableState
impl RestorationMixin for ScrollableState
Source§fn restoration_mixin_data(
self: Handle<Self>,
app: &App,
) -> &RestorationMixinData
fn restoration_mixin_data( self: Handle<Self>, app: &App, ) -> &RestorationMixinData
Source§fn restoration_mixin_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut RestorationMixinData
fn restoration_mixin_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut RestorationMixinData
Source§fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
fn restoration_id(self: Handle<Self>, app: &App) -> Option<&str>
RestorationBucket in which the mixin will store the
restoration data of all registered properties. Read moreSource§fn restore_state(
self: Handle<Self>,
app: &mut App,
_old_bucket: Option<Handle<RestorationBucket>>,
initial_restore: bool,
)
fn restore_state( self: Handle<Self>, app: &mut App, _old_bucket: Option<Handle<RestorationBucket>>, initial_restore: bool, )
Source§fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
fn bucket(self: Handle<Self>, app: &App) -> Option<Handle<RestorationBucket>>
RestorationBucket used for the restoration data of the RestorablePropertys
registered to this mixin. Read moreSource§fn did_toggle_bucket(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn did_toggle_bucket( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
Source§fn register_for_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
restoration_id: &str,
)
fn register_for_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, restoration_id: &str, )
RestorableProperty for state restoration. Read moreSource§fn unregister_from_restoration(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister_from_restoration( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorableProperty from state restoration. Read moreSource§fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
fn did_update_restoration_id(self: Handle<Self>, app: &mut App)
restoration_id
changes. Read moreSource§fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
fn restore_pending(self: Handle<Self>, app: &mut App) -> bool
restore_state will be called at the beginning of the
next build phase. Read moreSource§fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
fn did_change_dependencies_restoration(self: Handle<Self>, app: &mut App)
RestorationMixin.didChangeDependencies, called by the State from its own
State::did_change_dependencies.Source§fn dispose_restoration(self: Handle<Self>, app: &mut App)
fn dispose_restoration(self: Handle<Self>, app: &mut App)
Source§fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
fn as_restoration_mixin(self: Handle<Self>) -> AnyRestorationMixin
AnyRestorationMixin — what a RestorableProperty keeps as
its owner.Source§fn do_restore(
self: Handle<Self>,
app: &mut App,
old_bucket: Option<Handle<RestorationBucket>>,
)
fn do_restore( self: Handle<Self>, app: &mut App, old_bucket: Option<Handle<RestorationBucket>>, )
_doRestore.Source§fn update_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
parent: Option<Handle<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn update_bucket_if_necessary( self: Handle<Self>, app: &mut App, parent: Option<Handle<RestorationBucket>>, restore_pending: bool, ) -> bool
_updateBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn set_new_bucket_if_necessary(
self: Handle<Self>,
app: &mut App,
new_bucket: Option<Ref<RestorationBucket>>,
restore_pending: bool,
) -> bool
fn set_new_bucket_if_necessary( self: Handle<Self>, app: &mut App, new_bucket: Option<Ref<RestorationBucket>>, restore_pending: bool, ) -> bool
_setNewBucketIfNecessary. Returns true if bucket has been
replaced with a new bucket; it is the responsibility of the caller to dispose the old
bucket when this returns true.Source§fn update_property(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn update_property( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
_updateProperty.Source§fn unregister(
self: Handle<Self>,
app: &mut App,
property: AnyRestorableProperty,
)
fn unregister( self: Handle<Self>, app: &mut App, property: AnyRestorableProperty, )
RestorationMixin._unregister.Source§impl State for ScrollableState
impl State for ScrollableState
Source§type Widget = Scrollable
type Widget = Scrollable
State<T> type argument.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(self: Handle<Self>, app: &mut App, old_widget: &Scrollable)
fn did_update_widget(self: Handle<Self>, app: &mut App, old_widget: &Scrollable)
Source§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> BuildContext
fn context(self: Handle<Self>, app: &App) -> BuildContext
Source§impl TickerProviderObject for ScrollableState
impl TickerProviderObject for ScrollableState
Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
Source§impl TickerProviderStateMixin for ScrollableState
impl TickerProviderStateMixin for ScrollableState
Source§fn ticker_provider_data(
self: Handle<Self>,
app: &App,
) -> &TickerProviderStateMixinData
fn ticker_provider_data( self: Handle<Self>, app: &App, ) -> &TickerProviderStateMixinData
Source§fn ticker_provider_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut TickerProviderStateMixinData
fn ticker_provider_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut TickerProviderStateMixinData
ticker_provider_data.Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
TickerProviderStateMixin.debugFillProperties, which a state’s own body calls
where Dart’s mixin adds its line.Source§fn create_ticker(
self: Handle<Self>,
app: &mut App,
on_tick: TickerCallback,
) -> Ref<Ticker>
fn create_ticker( self: Handle<Self>, app: &mut App, on_tick: TickerCallback, ) -> Ref<Ticker>
TickerProvider::create_ticker: creates a ticker with the given callback.