BlocxCollectionView<Entity extends BlocxBaseEntity, Payload> class
A composable widget that renders a BlocxCollectionBloc.
Unlike BlocxCollectionWidgetState, BlocxCollectionView is a standalone widget that can be embedded anywhere in a Flutter widget tree without requiring a full screen-level state subclass.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BlocxCollectionView
Constructors
-
BlocxCollectionView({Key? key, required BlocxCollectionBloc<
Entity, Payload> bloc, required Widget itemBuilder(BuildContext context, Entity item), CollectionSettings? settings, ScrollController? scrollController, double topBottomAndListSpacing = 8.0, Widget? topWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget? bottomWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget? sliverTopWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget? sliverBottomWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget loadingWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget emptyWidget(BuildContext context, BlocxCollectionState<Entity> state)?, Widget errorWidget(BuildContext context, BlocxCollectionStateError<Entity> state)?, Widget separatorBuilder(BuildContext context, int index)?, AnimatedChildBuilder? deleteAnimation, AnimatedChildBuilder? insertAnimation, Widget? refreshWidgetBuilder(BuildContext context, double swipeRefreshHeight)?, Widget? loadMoreWidgetBuilder(BuildContext context, bool isLoadingMore)?, void onSelectionChanged(BuildContext context, SelectionChangedData<Entity> selectionData)?, void listener(BuildContext context, BlocxCollectionState<Entity> state)?, Widget collectionWidgetBuilder(BuildContext context, BlocxCollectionState<Entity> state)?, Widget wrapperBuilder(BuildContext context, BlocxCollectionState<Entity> state)?, VoidCallback? onRetry}) -
Creates a composable collection view.
const
Properties
-
bloc
→ BlocxCollectionBloc<
Entity, Payload> -
The collection bloc driving this view.
final
-
bottomWidget
→ Widget? Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional widget displayed below the collection.
final
-
collectionWidgetBuilder
→ Widget Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional override for the concrete collection widget builder.
final
- deleteAnimation → AnimatedChildBuilder?
-
Optional delete animation builder for animated lists.
final
-
emptyWidget
→ Widget Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Builder for the empty state.
final
-
errorWidget
→ Widget Function(BuildContext context, BlocxCollectionStateError<
Entity> state)? -
Builder for the initial-load error state.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- insertAnimation → AnimatedChildBuilder?
-
Optional insert animation builder for animated lists.
final
- itemBuilder → Widget Function(BuildContext context, Entity item)
-
Builds a visual item for
item.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
listener
→ void Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional custom listener for listen-only states.
final
-
loadingWidget
→ Widget Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Builder for the loading state.
final
- loadMoreWidgetBuilder → Widget? Function(BuildContext context, bool isLoadingMore)?
-
Builds a custom load-more indicator.
final
- onRetry → VoidCallback?
-
Callback invoked when the user taps retry on the default error widget.
final
-
onSelectionChanged
→ void Function(BuildContext context, SelectionChangedData<
Entity> selectionData)? -
Callback invoked when item selection changes.
final
- refreshWidgetBuilder → Widget? Function(BuildContext context, double swipeRefreshHeight)?
-
Builds a custom refresh indicator.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
Optional external scroll controller.
final
- separatorBuilder → Widget Function(BuildContext context, int index)?
-
Builds a separator between list items.
final
- settings → CollectionSettings?
-
Rendering configuration and options.
final
-
sliverBottomWidget
→ Widget? Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional sliver displayed below sliver collections.
final
-
sliverTopWidget
→ Widget? Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional sliver displayed above sliver collections.
final
- topBottomAndListSpacing → double
-
Spacing between optional top/bottom widgets and the core collection.
final
-
topWidget
→ Widget? Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional widget displayed above the collection.
final
-
wrapperBuilder
→ Widget Function(BuildContext context, BlocxCollectionState<
Entity> state)? -
Optional override for the outer wrapper builder surrounding the collection.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BlocxCollectionView< Entity, Payload> > -
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