pub struct ScrollPositionBase;Expand description
The shared bodies of Dart’s ScrollPosition: call one where Dart writes super.….
Implementations§
Source§impl ScrollPositionBase
impl ScrollPositionBase
Sourcepub fn init<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
old_position: Option<AnyScrollPosition>,
)
pub fn init<P: ScrollPosition>( this: Handle<P>, app: &mut App, old_position: Option<AnyScrollPosition>, )
Dart’s ScrollPosition constructor body: absorb the old position, then restore the
saved scroll offset.
A leaf’s constructor calls this right after App::create, where Dart’s superclass
constructor would run.
Sourcepub fn pixels<P: ScrollPosition>(this: Handle<P>, app: &App) -> f64
pub fn pixels<P: ScrollPosition>(this: Handle<P>, app: &App) -> f64
See ViewportOffset::pixels, which a ScrollPosition answers from its bag.
Sourcepub fn has_pixels<P: ScrollPosition>(this: Handle<P>, app: &App) -> bool
pub fn has_pixels<P: ScrollPosition>(this: Handle<P>, app: &App) -> bool
See ViewportOffset::has_pixels, which a ScrollPosition answers from its bag.
Sourcepub fn absorb<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
other: AnyScrollPosition,
)
pub fn absorb<P: ScrollPosition>( this: Handle<P>, app: &mut App, other: AnyScrollPosition, )
Sourcepub fn set_pixels<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
new_pixels: f64,
) -> f64
pub fn set_pixels<P: ScrollPosition>( this: Handle<P>, app: &mut App, new_pixels: f64, ) -> f64
Sourcepub fn correct_by<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
correction: f64,
)
pub fn correct_by<P: ScrollPosition>( this: Handle<P>, app: &mut App, correction: f64, )
See ViewportOffset::correct_by, which a ScrollPosition overrides.
Sourcepub fn force_pixels<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
value: f64,
)
pub fn force_pixels<P: ScrollPosition>( this: Handle<P>, app: &mut App, value: f64, )
Sourcepub fn save_scroll_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
pub fn save_scroll_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
Sourcepub fn restore_scroll_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
pub fn restore_scroll_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
Sourcepub fn restore_offset<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
offset: f64,
initial_restore: bool,
)
pub fn restore_offset<P: ScrollPosition>( this: Handle<P>, app: &mut App, offset: f64, initial_restore: bool, )
Sourcepub fn save_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
pub fn save_offset<P: ScrollPosition>(this: Handle<P>, app: &mut App)
Sourcepub fn apply_boundary_conditions<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
value: f64,
) -> f64
pub fn apply_boundary_conditions<P: ScrollPosition>( this: Handle<P>, app: &mut App, value: f64, ) -> f64
Sourcepub fn apply_viewport_dimension<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
viewport_dimension: f64,
) -> bool
pub fn apply_viewport_dimension<P: ScrollPosition>( this: Handle<P>, app: &mut App, viewport_dimension: f64, ) -> bool
See ViewportOffset::apply_viewport_dimension, which a ScrollPosition overrides.
Sourcepub fn apply_content_dimensions<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
min_scroll_extent: f64,
max_scroll_extent: f64,
) -> bool
pub fn apply_content_dimensions<P: ScrollPosition>( this: Handle<P>, app: &mut App, min_scroll_extent: f64, max_scroll_extent: f64, ) -> bool
See ViewportOffset::apply_content_dimensions, which a ScrollPosition overrides.
Sourcepub fn correct_for_new_dimensions<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
old_position: &dyn ScrollMetrics,
new_position: &dyn ScrollMetrics,
) -> bool
pub fn correct_for_new_dimensions<P: ScrollPosition>( this: Handle<P>, app: &mut App, old_position: &dyn ScrollMetrics, new_position: &dyn ScrollMetrics, ) -> bool
Sourcepub fn apply_new_dimensions<P: ScrollPosition>(this: Handle<P>, app: &mut App)
pub fn apply_new_dimensions<P: ScrollPosition>(this: Handle<P>, app: &mut App)
Sourcepub fn ensure_visible<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
object: AnyRenderObject,
alignment: f64,
duration: Duration,
curve: Rc<dyn Curve>,
alignment_policy: ScrollPositionAlignmentPolicy,
target_render_object: Option<AnyRenderObject>,
) -> CompleterFuture<()> ⓘ
pub fn ensure_visible<P: ScrollPosition>( this: Handle<P>, app: &mut App, object: AnyRenderObject, alignment: f64, duration: Duration, curve: Rc<dyn Curve>, alignment_policy: ScrollPositionAlignmentPolicy, target_render_object: Option<AnyRenderObject>, ) -> CompleterFuture<()> ⓘ
Sourcepub fn move_to<P: ScrollPosition>(
this: Handle<P>,
app: &mut App,
to: f64,
duration: Option<Duration>,
curve: Option<Rc<dyn Curve>>,
clamp: Option<bool>,
) -> CompleterFuture<()> ⓘ
pub fn move_to<P: ScrollPosition>( this: Handle<P>, app: &mut App, to: f64, duration: Option<Duration>, curve: Option<Rc<dyn Curve>>, clamp: Option<bool>, ) -> CompleterFuture<()> ⓘ
See ViewportOffset::move_to, which a ScrollPosition overrides.
Sourcepub fn allow_implicit_scrolling<P: ScrollPosition>(
this: Handle<P>,
app: &App,
) -> bool
pub fn allow_implicit_scrolling<P: ScrollPosition>( this: Handle<P>, app: &App, ) -> bool
See ViewportOffset::allow_implicit_scrolling, which a ScrollPosition overrides.