pub struct SliverFillViewport {
pub key: Option<KeyRef>,
pub viewport_fraction: f64,
pub pad_ends: bool,
pub delegate: SliverChildDelegateRef,
pub allow_implicit_scrolling: bool,
}Expand description
A sliver that contains multiple box children that each fills the viewport.
To learn more about slivers, see CustomScrollView::slivers.
SliverFillViewport places its children in a linear array along the main axis. Each child
is sized to fill the viewport, both in the main and cross axis.
See also:
crate::SliverFixedExtentList, which has a configurableitem_extent.SliverPrototypeExtentList, which is similar tocrate::SliverFixedExtentListexcept that it uses a prototype list item instead of a pixel value to define the main axis extent of each item.crate::SliverList, which does not require its children to have the same extent in the main axis.
Fields§
§key: Option<KeyRef>§viewport_fraction: f64The fraction of the viewport that each child should fill in the main axis.
If this fraction is less than 1.0, more than one child will be visible at once. If this fraction is greater than 1.0, each child will be larger than the viewport in the main axis.
pad_ends: boolWhether to add padding to both ends of the list.
If this is set to true and viewport_fraction < 1.0, padding
will be added such that the first and last child slivers will be in the center of the
viewport when scrolled all the way to the start or end, respectively. You may want to set
this to false if this SliverFillViewport is not the only widget along this main axis,
such as in a CustomScrollView with multiple children.
If viewport_fraction is greater than one, this option has no
effect. Defaults to true.
delegate: SliverChildDelegateRefThe delegate that provides the children for this widget.
allow_implicit_scrolling: boolWhether the pages answer implicit scrolling, as PageView::allow_implicit_scrolling
describes.
Implementations§
Source§impl SliverFillViewport
impl SliverFillViewport
Sourcepub fn new(delegate: SliverChildDelegateRef) -> SliverFillViewport
pub fn new(delegate: SliverChildDelegateRef) -> SliverFillViewport
Creates a sliver whose box children that each fill the viewport.
Sourcepub fn key(self, key: KeyRef) -> SliverFillViewport
pub fn key(self, key: KeyRef) -> SliverFillViewport
Dart SliverFillViewport(key:).
Sourcepub fn viewport_fraction(self, viewport_fraction: f64) -> SliverFillViewport
pub fn viewport_fraction(self, viewport_fraction: f64) -> SliverFillViewport
Dart SliverFillViewport(viewportFraction:).
Sourcepub fn pad_ends(self, pad_ends: bool) -> SliverFillViewport
pub fn pad_ends(self, pad_ends: bool) -> SliverFillViewport
Dart SliverFillViewport(padEnds:).
Sourcepub fn allow_implicit_scrolling(
self,
allow_implicit_scrolling: bool,
) -> SliverFillViewport
pub fn allow_implicit_scrolling( self, allow_implicit_scrolling: bool, ) -> SliverFillViewport
Dart SliverFillViewport(allowImplicitScrolling:).
Trait Implementations§
Source§impl Debug for SliverFillViewport
impl Debug for SliverFillViewport
Source§impl StatelessWidget for SliverFillViewport
impl StatelessWidget for SliverFillViewport
Source§fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, _app: &mut App, _context: BuildContext) -> WidgetRef
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 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 SliverFillViewport
impl !Send for SliverFillViewport
impl !Sync for SliverFillViewport
impl !UnwindSafe for SliverFillViewport
impl Forget for SliverFillViewport
impl Freeze for SliverFillViewportwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn SliverChildDelegate> is !null: Freeze,
PhantomData<RcInner<dyn SliverChildDelegate>>: Freeze,
impl Move for SliverFillViewport
impl Unpin for SliverFillViewport
impl UnsafeUnpin for SliverFillViewportwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn SliverChildDelegate> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SliverChildDelegate>>: 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.