InfiniteGrid<Entity extends BaseEntity> class
InfiniteGrid
A grid-based equivalent of your InfiniteList with the same interaction model:
- Uses the provided
InfiniteListBloc
for scroll/refresh/load-more signals - Triggers
loadBottomData
when the user nears the end - Optional swipe-to-refresh (custom, like your list)
- Supports
AutoScrollController
viaAutoScrollTag
Differences from list version:
- Uses
GridView.builder
with a configurable grid delegate - No third-party animated grid. For simple entry effects, wrap your
itemBuilder
content in anAnimatedSwitcher
/FadeTransition
yourself.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- InfiniteGrid
Constructors
-
InfiniteGrid.new({Key? key, required InfiniteGridOptions options, required List<
Entity> items, required Widget itemBuilder(BuildContext context, Entity item), required InfiniteListBloc bloc, SliverGridDelegate gridDelegateBuilder(InfiniteGridOptions options)?, Widget? refreshWidgetBuilder(BuildContext context, double swipeRefreshHeight)?, Widget? loadMoreWidgetBuilder(BuildContext context, bool isLoadingMore)?, void refreshOnSwipe()?, void loadBottomData()?, void loadTopData()?, ScrollController? scrollController}) -
const
Properties
- bloc → InfiniteListBloc
-
final
- gridDelegateBuilder → SliverGridDelegate Function(InfiniteGridOptions options)?
-
Grid-specific builder for a custom SliverGridDelegate.
If null, a default delegate is created from options.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemBuilder → Widget Function(BuildContext context, Entity item)
-
final
-
items
→ List<
Entity> -
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadBottomData → void Function()?
-
final
- loadMoreWidgetBuilder → Widget? Function(BuildContext context, bool isLoadingMore)?
-
final
- loadTopData → void Function()?
-
final
- options → InfiniteGridOptions
-
final
- refreshOnSwipe → void Function()?
-
final
- refreshWidgetBuilder → Widget? Function(BuildContext context, double swipeRefreshHeight)?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → InfiniteGridState< Entity> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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