GroupedPagingGrid<PageKey, Parent, Value> class
A high-level widget that displays a scrollable, paginated grid with grouped items.
GroupedPagingGrid is a convenient wrapper around SliverGroupedPagingGrid
that handles creating the CustomScrollView for you. It's the easiest way
to display a grid with sections and headers.
It requires a GroupedDataSource to provide the data and grouping logic.
For more complex layouts, such as those with a SliverAppBar or multiple
slivers, consider using SliverGroupedPagingGrid directly inside a
CustomScrollView.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GroupedPagingGrid
Constructors
-
GroupedPagingGrid({Key? key, required SliverGridDelegate gridDelegate, required GroupedDataSource<
PageKey, Parent, Value> dataSource, required TypedWidgetBuilder<Parent> headerBuilder, required GroupedTypedWidgetBuilder<Value> itemBuilder, ExceptionWidgetBuilder? errorBuilder, Widget? initialLoadingWidget, Widget? prependLoadingWidget, Widget? appendLoadingWidget, Widget? emptyWidget, bool fillRemainErrorWidget = true, bool fillRemainEmptyWidget = true, EdgeInsets padding = EdgeInsets.zero, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollController? controller, bool? primary, ScrollPhysics? physics, ScrollBehavior? scrollBehavior, bool shrinkWrap = false, double? cacheExtent, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, Clip clipBehavior = Clip.hardEdge, bool stickyHeader = false, Widget? stickyHeaderMinExtentPrototype, Widget? stickyHeaderMaxExtentPrototype, bool autoLoadPrepend = true, bool autoLoadAppend = true}) -
Creates a scrollable, 2D array of widgets that are created on demand.
const
Properties
- appendLoadingWidget → Widget?
-
The widget to display at the bottom of the grid 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
- cacheExtent → double?
-
The cache extent of the scroll view.
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
→ GroupedDataSource<
PageKey, Parent, Value> -
The GroupedDataSource that provides the paginated and grouped data.
final
- dragStartBehavior → DragStartBehavior
-
Determines the way that drag start behavior is handled.
final
- emptyWidget → Widget?
-
The widget to display when the grid 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
- gridDelegate → SliverGridDelegate
-
A delegate that controls the layout of the children within the grid.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headerBuilder
→ TypedWidgetBuilder<
Parent> -
A builder that creates a widget for each group header.
final
- initialLoadingWidget → Widget?
-
The widget to display while the first page is being loaded.
final
-
itemBuilder
→ GroupedTypedWidgetBuilder<
Value> -
A builder that creates a widget for each item within a group.
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 grid 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
- 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
- stickyHeader → bool
-
If
true, group headers will remain visible at the top of the screen as the user scrolls down through the items in that group.final - stickyHeaderMaxExtentPrototype → Widget?
-
A prototype widget for calculating the maximum extent of a sticky header.
final
- stickyHeaderMinExtentPrototype → Widget?
-
A prototype widget for calculating the minimum extent of a sticky header.
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