pub trait RenderSliverFloatingPersistentHeader: RenderSliverPersistentHeader {
Show 19 methods
// Required methods
fn floating_data(
self: RenderHandle<Self>,
app: &App,
) -> &RenderSliverFloatingPersistentHeaderData;
fn floating_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderSliverFloatingPersistentHeaderData;
// Provided methods
fn did_detach(self: RenderHandle<Self>, app: &mut App) { ... }
fn vsync(self: RenderHandle<Self>, app: &App) -> Option<TickerProviderRef> { ... }
fn set_vsync(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TickerProviderRef>,
) { ... }
fn snap_configuration(
self: RenderHandle<Self>,
app: &App,
) -> Option<FloatingHeaderSnapConfiguration> { ... }
fn set_snap_configuration(
self: RenderHandle<Self>,
app: &mut App,
value: Option<FloatingHeaderSnapConfiguration>,
) { ... }
fn show_on_screen_configuration(
self: RenderHandle<Self>,
app: &App,
) -> Option<PersistentHeaderShowOnScreenConfiguration> { ... }
fn set_show_on_screen_configuration(
self: RenderHandle<Self>,
app: &mut App,
value: Option<PersistentHeaderShowOnScreenConfiguration>,
) { ... }
fn effective_scroll_offset(
self: RenderHandle<Self>,
app: &App,
) -> Option<f64> { ... }
fn update_geometry(self: RenderHandle<Self>, app: &mut App) -> f64 { ... }
fn update_animation(
self: RenderHandle<Self>,
app: &mut App,
duration: Duration,
end_value: f64,
curve: Rc<dyn Curve>,
) { ... }
fn update_scroll_start_direction(
self: RenderHandle<Self>,
app: &mut App,
direction: ScrollDirection,
) { ... }
fn maybe_start_snap_animation(
self: RenderHandle<Self>,
app: &mut App,
direction: ScrollDirection,
) { ... }
fn maybe_stop_snap_animation(
self: RenderHandle<Self>,
app: &mut App,
_direction: ScrollDirection,
) { ... }
fn perform_layout(self: RenderHandle<Self>, app: &mut App) { ... }
fn show_on_screen(
self: RenderHandle<Self>,
app: &mut App,
descendant: Option<AnyRenderObject>,
rect: Option<Rect>,
duration: Duration,
curve: Rc<dyn Curve>,
) { ... }
fn child_main_axis_position(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderObject,
) -> f64 { ... }
fn as_floating_persistent_header(
self: RenderHandle<Self>,
) -> AnyRenderSliverFloatingPersistentHeader { ... }
}Expand description
A sliver with a box child which shrinks and scrolls like a
RenderSliverScrollingPersistentHeader, but immediately comes back when the user scrolls in
the reverse direction.
See also:
RenderSliverFloatingPinnedPersistentHeader, which is similar but sticks to the start of the viewport rather than scrolling off.
Required Methods§
Sourcefn floating_data(
self: RenderHandle<Self>,
app: &App,
) -> &RenderSliverFloatingPersistentHeaderData
fn floating_data( self: RenderHandle<Self>, app: &App, ) -> &RenderSliverFloatingPersistentHeaderData
Mixin field access.
Sourcefn floating_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RenderSliverFloatingPersistentHeaderData
fn floating_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RenderSliverFloatingPersistentHeaderData
See floating_data.
Provided Methods§
Sourcefn did_detach(self: RenderHandle<Self>, app: &mut App)
fn did_detach(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s detach override: disposes the snap animation controller, which is
lazily recreated if we are reattached.
Sourcefn vsync(self: RenderHandle<Self>, app: &App) -> Option<TickerProviderRef>
fn vsync(self: RenderHandle<Self>, app: &App) -> Option<TickerProviderRef>
A TickerProvider to use when animating the scroll position.
Sourcefn set_vsync(
self: RenderHandle<Self>,
app: &mut App,
value: Option<TickerProviderRef>,
)
fn set_vsync( self: RenderHandle<Self>, app: &mut App, value: Option<TickerProviderRef>, )
Sets vsync.
Sourcefn snap_configuration(
self: RenderHandle<Self>,
app: &App,
) -> Option<FloatingHeaderSnapConfiguration>
fn snap_configuration( self: RenderHandle<Self>, app: &App, ) -> Option<FloatingHeaderSnapConfiguration>
Defines the parameters used to snap (animate) the floating header in and out of view.
Sourcefn set_snap_configuration(
self: RenderHandle<Self>,
app: &mut App,
value: Option<FloatingHeaderSnapConfiguration>,
)
fn set_snap_configuration( self: RenderHandle<Self>, app: &mut App, value: Option<FloatingHeaderSnapConfiguration>, )
Sets snap_configuration.
Sourcefn show_on_screen_configuration(
self: RenderHandle<Self>,
app: &App,
) -> Option<PersistentHeaderShowOnScreenConfiguration>
fn show_on_screen_configuration( self: RenderHandle<Self>, app: &App, ) -> Option<PersistentHeaderShowOnScreenConfiguration>
Specifies the persistent header’s behavior when show_on_screen is called.
Sourcefn set_show_on_screen_configuration(
self: RenderHandle<Self>,
app: &mut App,
value: Option<PersistentHeaderShowOnScreenConfiguration>,
)
fn set_show_on_screen_configuration( self: RenderHandle<Self>, app: &mut App, value: Option<PersistentHeaderShowOnScreenConfiguration>, )
Sourcefn effective_scroll_offset(self: RenderHandle<Self>, app: &App) -> Option<f64>
fn effective_scroll_offset(self: RenderHandle<Self>, app: &App) -> Option<f64>
Flutter’s _effectiveScrollOffset, the offset the header is laid out at.
Sourcefn update_geometry(self: RenderHandle<Self>, app: &mut App) -> f64
fn update_geometry(self: RenderHandle<Self>, app: &mut App) -> f64
Updates the geometry, and returns the new value for
RenderSliver::child_main_axis_position.
Sourcefn update_animation(
self: RenderHandle<Self>,
app: &mut App,
duration: Duration,
end_value: f64,
curve: Rc<dyn Curve>,
)
fn update_animation( self: RenderHandle<Self>, app: &mut App, duration: Duration, end_value: f64, curve: Rc<dyn Curve>, )
Flutter’s _updateAnimation.
Sourcefn update_scroll_start_direction(
self: RenderHandle<Self>,
app: &mut App,
direction: ScrollDirection,
)
fn update_scroll_start_direction( self: RenderHandle<Self>, app: &mut App, direction: ScrollDirection, )
Update the last known scroll direction when scrolling began.
Sourcefn maybe_start_snap_animation(
self: RenderHandle<Self>,
app: &mut App,
direction: ScrollDirection,
)
fn maybe_start_snap_animation( self: RenderHandle<Self>, app: &mut App, direction: ScrollDirection, )
If the header isn’t already fully exposed, then scroll it into view.
Sourcefn maybe_stop_snap_animation(
self: RenderHandle<Self>,
app: &mut App,
_direction: ScrollDirection,
)
fn maybe_stop_snap_animation( self: RenderHandle<Self>, app: &mut App, _direction: ScrollDirection, )
If a header snap animation or a show_on_screen expand animation is underway then stop it.
Sourcefn perform_layout(self: RenderHandle<Self>, app: &mut App)
fn perform_layout(self: RenderHandle<Self>, app: &mut App)
The body of Flutter’s performLayout override.
Sourcefn show_on_screen(
self: RenderHandle<Self>,
app: &mut App,
descendant: Option<AnyRenderObject>,
rect: Option<Rect>,
duration: Duration,
curve: Rc<dyn Curve>,
)
fn show_on_screen( self: RenderHandle<Self>, app: &mut App, descendant: Option<AnyRenderObject>, rect: Option<Rect>, duration: Duration, curve: Rc<dyn Curve>, )
The body of Flutter’s showOnScreen override.
Sourcefn child_main_axis_position(
self: RenderHandle<Self>,
app: &App,
child: AnyRenderObject,
) -> f64
fn child_main_axis_position( self: RenderHandle<Self>, app: &App, child: AnyRenderObject, ) -> f64
The body of Flutter’s childMainAxisPosition override.
Sourcefn as_floating_persistent_header(
self: RenderHandle<Self>,
) -> AnyRenderSliverFloatingPersistentHeader
fn as_floating_persistent_header( self: RenderHandle<Self>, ) -> AnyRenderSliverFloatingPersistentHeader
The type-erased RenderSliverFloatingPersistentHeader handle. Free: the vtable is a
const, and the id is copied.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".