pub struct CustomScrollView {
pub slivers: Vec<WidgetRef>,
/* private fields */
}Expand description
A ScrollView that combines multiple slivers in one scrollable view.
A CustomScrollView lets you combine lists, grids, and other widgets in a
single scrollable view by supplying slivers directly. Slivers can
represent lists, grids, and expanding headers. Widgets that use the box
layout model can be included using a SliverToBoxAdapter.
CustomScrollView::new().slivers([
SliverToBoxAdapter::new().child(header).into_widget(),
SliverList::list(items).into_widget(),
])Fields§
§slivers: Vec<WidgetRef>The slivers to place inside the viewport.
A sliver is a widget backed by a RenderSliver, i.e. one that implements the
constraint/geometry protocol that uses SliverConstraints and SliverGeometry.
This is as distinct from those widgets that are backed by RenderBox, which use
BoxConstraints and Size respectively, and are known as box widgets.
While boxes are much more straightforward (implementing a simple two-dimensional Cartesian layout system), slivers are much more powerful, and are optimized for one-axis scrolling environments.
In general, slivers always wrap box widgets to actually render anything; the sliver part of the equation is mostly about how these boxes should be laid out in a viewport.
Implementations§
Source§impl CustomScrollView
impl CustomScrollView
Sourcepub fn new() -> CustomScrollView
pub fn new() -> CustomScrollView
Creates a ScrollView that combines multiple slivers in one scrollable
view.
Sourcepub fn key(self, key: KeyRef) -> CustomScrollView
pub fn key(self, key: KeyRef) -> CustomScrollView
Dart key:.
Sourcepub fn scroll_direction(self, scroll_direction: Axis) -> CustomScrollView
pub fn scroll_direction(self, scroll_direction: Axis) -> CustomScrollView
Dart scrollDirection:.
Sourcepub fn reverse(self, reverse: bool) -> CustomScrollView
pub fn reverse(self, reverse: bool) -> CustomScrollView
Dart reverse:.
Sourcepub fn controller(self, controller: ScrollControllerRef) -> CustomScrollView
pub fn controller(self, controller: ScrollControllerRef) -> CustomScrollView
Dart controller:.
Sourcepub fn primary(self, primary: bool) -> CustomScrollView
pub fn primary(self, primary: bool) -> CustomScrollView
Dart primary:.
Sourcepub fn physics(self, physics: ScrollPhysicsRef) -> CustomScrollView
pub fn physics(self, physics: ScrollPhysicsRef) -> CustomScrollView
Dart physics:.
Sourcepub fn shrink_wrap(self, shrink_wrap: bool) -> CustomScrollView
pub fn shrink_wrap(self, shrink_wrap: bool) -> CustomScrollView
Dart shrinkWrap:.
Sourcepub fn cache_extent(self, cache_extent: f64) -> CustomScrollView
👎Deprecated: Use scroll_cache_extent instead.
pub fn cache_extent(self, cache_extent: f64) -> CustomScrollView
Use scroll_cache_extent instead.
Dart cacheExtent:.
Sourcepub fn scroll_cache_extent(
self,
scroll_cache_extent: ScrollCacheExtent,
) -> CustomScrollView
pub fn scroll_cache_extent( self, scroll_cache_extent: ScrollCacheExtent, ) -> CustomScrollView
Dart scrollCacheExtent:.
Sourcepub fn semantic_child_count(self, semantic_child_count: i32) -> CustomScrollView
pub fn semantic_child_count(self, semantic_child_count: i32) -> CustomScrollView
Dart semanticChildCount:.
Sourcepub fn drag_start_behavior(
self,
drag_start_behavior: DragStartBehavior,
) -> CustomScrollView
pub fn drag_start_behavior( self, drag_start_behavior: DragStartBehavior, ) -> CustomScrollView
Dart dragStartBehavior:.
Sourcepub fn keyboard_dismiss_behavior(
self,
keyboard_dismiss_behavior: ScrollViewKeyboardDismissBehavior,
) -> CustomScrollView
pub fn keyboard_dismiss_behavior( self, keyboard_dismiss_behavior: ScrollViewKeyboardDismissBehavior, ) -> CustomScrollView
Dart keyboardDismissBehavior:.
Sourcepub fn restoration_id(
self,
restoration_id: impl Into<String>,
) -> CustomScrollView
pub fn restoration_id( self, restoration_id: impl Into<String>, ) -> CustomScrollView
Dart restorationId:.
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> CustomScrollView
pub fn clip_behavior(self, clip_behavior: Clip) -> CustomScrollView
Dart clipBehavior:.
Sourcepub fn hit_test_behavior(
self,
hit_test_behavior: HitTestBehavior,
) -> CustomScrollView
pub fn hit_test_behavior( self, hit_test_behavior: HitTestBehavior, ) -> CustomScrollView
Dart hitTestBehavior:.
Sourcepub fn scroll_behavior(
self,
scroll_behavior: ScrollBehaviorRef,
) -> CustomScrollView
pub fn scroll_behavior( self, scroll_behavior: ScrollBehaviorRef, ) -> CustomScrollView
Dart CustomScrollView(scrollBehavior:).
Sourcepub fn center(self, center: KeyRef) -> CustomScrollView
pub fn center(self, center: KeyRef) -> CustomScrollView
Dart CustomScrollView(center:).
Sourcepub fn anchor(self, anchor: f64) -> CustomScrollView
pub fn anchor(self, anchor: f64) -> CustomScrollView
Dart CustomScrollView(anchor:).
Sourcepub fn paint_order(self, paint_order: SliverPaintOrder) -> CustomScrollView
pub fn paint_order(self, paint_order: SliverPaintOrder) -> CustomScrollView
Dart CustomScrollView(paintOrder:).
Sourcepub fn slivers(
self,
slivers: impl IntoIterator<Item = WidgetRef>,
) -> CustomScrollView
pub fn slivers( self, slivers: impl IntoIterator<Item = WidgetRef>, ) -> CustomScrollView
Dart CustomScrollView(slivers:).
Trait Implementations§
Source§impl Clone for CustomScrollView
impl Clone for CustomScrollView
Source§impl Debug for CustomScrollView
impl Debug for CustomScrollView
Source§impl Default for CustomScrollView
impl Default for CustomScrollView
Source§impl ScrollView for CustomScrollView
impl ScrollView for CustomScrollView
Source§fn scroll_view_data(&self) -> &ScrollViewData
fn scroll_view_data(&self) -> &ScrollViewData
ScrollViewData bag (scroll_view_accessors!).Source§fn scroll_view_data_mut(&mut self) -> &mut ScrollViewData
fn scroll_view_data_mut(&mut self) -> &mut ScrollViewData
ScrollViewData bag, mutably.Source§fn build_slivers(
&self,
_app: &mut App,
_context: BuildContext,
) -> Vec<WidgetRef>
fn build_slivers( &self, _app: &mut App, _context: BuildContext, ) -> Vec<WidgetRef>
Source§fn get_direction(&self, app: &mut App, context: BuildContext) -> AxisDirection
fn get_direction(&self, app: &mut App, context: BuildContext) -> AxisDirection
AxisDirection in which the scroll view scrolls. Read moreSource§fn build_viewport(
&self,
app: &mut App,
context: BuildContext,
offset: ViewportOffsetRef,
axis_direction: AxisDirection,
slivers: Vec<WidgetRef>,
) -> WidgetRef
fn build_viewport( &self, app: &mut App, context: BuildContext, offset: ViewportOffsetRef, axis_direction: AxisDirection, slivers: Vec<WidgetRef>, ) -> WidgetRef
Source§impl StatelessWidget for CustomScrollView
impl StatelessWidget for CustomScrollView
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 CustomScrollView
impl !Send for CustomScrollView
impl !Sync for CustomScrollView
impl !UnwindSafe for CustomScrollView
impl Forget for CustomScrollView
impl Freeze for CustomScrollViewwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
&'static ScrollControllerVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn ScrollPhysics> is !null: Freeze,
PhantomData<RcInner<dyn ScrollPhysics>>: Freeze,
*const RcInner<dyn ScrollBehavior> is !null: Freeze,
PhantomData<RcInner<dyn ScrollBehavior>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Rc<dyn Widget>>: Freeze,
impl Move for CustomScrollView
impl Unpin for CustomScrollView
impl UnsafeUnpin for CustomScrollViewwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static ScrollControllerVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn ScrollPhysics> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ScrollPhysics>>: UnsafeUnpin,
*const RcInner<dyn ScrollBehavior> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ScrollBehavior>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Rc<dyn Widget>>: 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.