pub struct SliverPersistentHeader {
pub key: Option<KeyRef>,
pub delegate: SliverPersistentHeaderDelegateRef,
pub pinned: bool,
pub floating: bool,
}Expand description
A sliver whose size varies when the sliver is scrolled to the edge of the viewport opposite
the sliver’s GrowthDirection.
In the normal case of a CustomScrollView with no centered sliver, this sliver will vary its
size when scrolled to the leading edge of the viewport.
This is the layout primitive that SliverAppBar uses for its shrinking/growing effect.
To learn more about slivers, see CustomScrollView::slivers.
Fields§
§key: Option<KeyRef>§delegate: SliverPersistentHeaderDelegateRefConfiguration for the sliver’s layout.
The delegate provides the following information:
- The minimum and maximum dimensions of the sliver.
- The builder for generating the widgets of the sliver.
- The instructions for snapping the scroll offset, if
floatingis true.
pinned: boolWhether to stick the header to the start of the viewport once it has reached its minimum size.
If this is false, the header will continue scrolling off the screen after it has shrunk to its minimum extent.
floating: boolWhether the header should immediately grow again if the user reverses scroll direction.
If this is false, the header only grows again once the user reaches the part of the viewport that contains the sliver.
The delegate’s SliverPersistentHeaderDelegate::snap_configuration is ignored unless
this is true.
Implementations§
Source§impl SliverPersistentHeader
impl SliverPersistentHeader
Sourcepub fn new(
delegate: SliverPersistentHeaderDelegateRef,
) -> SliverPersistentHeader
pub fn new( delegate: SliverPersistentHeaderDelegateRef, ) -> SliverPersistentHeader
Creates a sliver that varies its size when it is scrolled to the start of a viewport.
Sourcepub fn key(self, key: KeyRef) -> SliverPersistentHeader
pub fn key(self, key: KeyRef) -> SliverPersistentHeader
Dart SliverPersistentHeader(key:).
Sourcepub fn pinned(self, pinned: bool) -> SliverPersistentHeader
pub fn pinned(self, pinned: bool) -> SliverPersistentHeader
Dart SliverPersistentHeader(pinned:).
Sourcepub fn floating(self, floating: bool) -> SliverPersistentHeader
pub fn floating(self, floating: bool) -> SliverPersistentHeader
Dart SliverPersistentHeader(floating:).
Trait Implementations§
Source§impl Debug for SliverPersistentHeader
impl Debug for SliverPersistentHeader
Source§impl StatelessWidget for SliverPersistentHeader
impl StatelessWidget for SliverPersistentHeader
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
Source§fn debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for SliverPersistentHeader
impl !Send for SliverPersistentHeader
impl !Sync for SliverPersistentHeader
impl !UnwindSafe for SliverPersistentHeader
impl Forget for SliverPersistentHeader
impl Freeze for SliverPersistentHeaderwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn SliverPersistentHeaderDelegate> is !null: Freeze,
PhantomData<RcInner<dyn SliverPersistentHeaderDelegate>>: Freeze,
impl Move for SliverPersistentHeader
impl Unpin for SliverPersistentHeader
impl UnsafeUnpin for SliverPersistentHeaderwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn SliverPersistentHeaderDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliverPersistentHeaderDelegate>>: UnsafeUnpin,
Blanket Implementations§
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<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.