PagingList<PageKey, Value> class
A high-level widget that displays a scrollable, paginated list of items.
PagingList is a convenient wrapper around SliverPagingList that
handles creating the CustomScrollView for you. It's the easiest way to
get started with displaying a simple, paginated list.
For more complex layouts, such as those with a SliverAppBar or multiple
slivers, consider using SliverPagingList directly inside a
CustomScrollView.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- PagingList
Constructors
-
PagingList({Key? key, required DataSource<
PageKey, Value> dataSource, required TypedWidgetBuilder<Value> builder, ExceptionWidgetBuilder? errorBuilder, Widget? initialLoadingWidget, Widget? prependLoadingWidget, Widget? appendLoadingWidget, Widget? emptyWidget, bool fillRemainErrorWidget = true, bool fillRemainEmptyWidget = true, EdgeInsets padding = EdgeInsets.zero, bool autoLoadPrepend = true, bool autoLoadAppend = true, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, bool shrinkWrap = false, ScrollCacheExtent? scrollCacheExtent, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, Clip clipBehavior = Clip.hardEdge}) -
Creates a scrollable, linear array of widgets that are created on demand.
const
-
PagingList.separated({Key? key, required DataSource<
PageKey, Value> dataSource, required TypedWidgetBuilder<Value> builder, ExceptionWidgetBuilder? errorBuilder, Widget? initialLoadingWidget, Widget? prependLoadingWidget, Widget? appendLoadingWidget, Widget? emptyWidget, bool fillRemainErrorWidget = true, bool fillRemainEmptyWidget = true, EdgeInsets padding = EdgeInsets.zero, bool autoLoadPrepend = true, bool autoLoadAppend = true, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, bool shrinkWrap = false, ScrollCacheExtent? scrollCacheExtent, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, Clip clipBehavior = Clip.hardEdge, required IndexedWidgetBuilder separatorBuilder}) -
Creates a scrollable linear array of list "items" separated
by list item "separators".
const
Properties
- appendLoadingWidget → Widget?
-
The widget to display at the bottom of the list when an
appendoperation is in progress.final - autoLoadAppend → bool
-
Automatically load more data at the end of the list
when reaching the boundary.
final
- autoLoadPrepend → bool
-
Automatically load more data at the beginning of the list
when reaching the boundary.
final
-
builder
→ TypedWidgetBuilder<
Value> -
A builder that creates a widget for each item in the list.
final
- clipBehavior → Clip
-
The content will be clipped (or not) according to this option.
final
- controller → ScrollController?
-
An object that can be used to control the position to which this scroll
view is scrolled.
final
-
dataSource
→ DataSource<
PageKey, Value> -
The DataSource that provides the paginated data.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- emptyWidget → Widget?
-
The widget to display when the list is empty.
final
- errorBuilder → ExceptionWidgetBuilder?
-
A builder that creates a widget to display when an error occurs.
final
- fillRemainEmptyWidget → bool
-
Whether the emptyWidget should be constrained to fill the viewport.
final
- fillRemainErrorWidget → bool
-
Whether the errorBuilder should be constrained to fill the viewport.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialLoadingWidget → Widget?
-
The widget to display while the first page is being loaded.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyboardDismissBehavior → ScrollViewKeyboardDismissBehavior
-
ScrollViewKeyboardDismissBehavior the defines how this ScrollView will
dismiss the keyboard automatically.
final
- padding → EdgeInsets
-
The amount of space by which to inset the children.
final
- physics → ScrollPhysics?
-
How the scroll view should respond to user input.
final
- prependLoadingWidget → Widget?
-
The widget to display at the top of the list when a
prependoperation is in progress.final - primary → bool?
-
Whether this is the primary scroll view associated with the parent
PrimaryScrollController.
final
- reverse → bool
-
Whether the scroll view scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollBehavior → ScrollBehavior?
-
A ScrollBehavior that will be applied to this widget individually.
final
- scrollCacheExtent → ScrollCacheExtent?
-
The cache extent of the scroll view.
final
- scrollDirection → Axis
-
The axis along which the scroll view scrolls.
final
- shrinkWrap → bool
-
Whether to wrap the entire scrollable contents in a Center widget.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited