BlocxCollectionWidgetState<W extends BlocxCollectionWidget<P> , T extends BlocxBaseEntity, P> class
abstract
Base state class for screens that host a BlocxCollectionBloc.
Provides standard list rendering, pagination, refresh handling, search, selection callbacks, scroll-to-item support, and screen-manager integration.
Type parameters:
W: The BlocxCollectionWidget subclass this state belongs to.T: The collection item entity type.P: The optional payload type used during initial loading.
- Inheritance
-
- Object
- State<
W> - BlocXWidgetState<
W> - BlocxCollectionWidgetState
Constructors
Properties
- autoDisposeBloc → bool
-
Whether
_blocis closed when this state is disposed.no setter -
bloc
→ BlocxCollectionBloc<
T, P> -
The collection bloc that drives this screen.
no setter
- colorScheme → ColorScheme
-
no setterinherited
- context → BuildContext
-
The location in the tree where this widget builds.
no setterinherited
- deleteAnimation → AnimatedChildBuilder?
-
Optional delete animation builder for animated collection widgets.
no setter
-
generateBloc
→ BlocxCollectionBloc<
T, P> -
Creates the collection bloc for this state.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
no setterinherited
- insertAnimation → AnimatedChildBuilder?
-
Optional insert animation builder for animated collection widgets.
no setter
- isLoading → bool
-
Whether the collection is currently loading its initial data.
no setter
- isSearching → bool
-
Whether the collection is currently searching.
no setter
- loadOnInit → bool
-
Whether initial data should be loaded during initState.
no setter
- managerCubit → ScreenManagerCubit
-
The
ScreenManagerCubitthat drives this screen's side-effects.no setter - mounted → bool
-
Whether this State object is currently in a tree.
no setterinherited
- payload → P?
-
The current widget payload.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController ↔ ScrollController?
-
The active scroll controller used by the rendered collection widget.
getter/setter pair
- scrollControllerProvider → ScrollController?
-
Optional external scroll controller provider.
no setter
- searchingText → String
-
Text shown while search is running.
no setter
- settings → CollectionSettings
-
Collection rendering settings.
no setter
- textTheme → TextTheme
-
no setterinherited
- theme → ThemeData
-
no setterinherited
- topBottomAndListSpacing → double
-
Vertical spacing between optional top/bottom widgets and the collection.
no setter
- widget → W
-
The current configuration.
no setterinherited
- width → double
-
no setterinherited
- wrapInScaffold → bool
-
Whether the body should be wrapped in a Scaffold.
no setterinherited
Methods
-
activate(
) → void -
Called when this object is reinserted into the tree after having been
removed via deactivate.
inherited
-
addToList(
T item, {int index = 0}) → void - Dispatches an add-item event.
-
blocListener(
BuildContext context, BlocxCollectionState< T> state) → void - Reacts to listen-only collection states.
-
bottomWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget? - Optional widget displayed below the collection.
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
collectionWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget -
Builds the concrete collection widget for
state. -
collectionWrapperBuilder(
BuildContext context, BlocxCollectionState< T> state) → Widget - Wraps the main collection widget with optional top and bottom widgets.
-
deactivate(
) → void -
Called when this object is removed from the tree.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
decorateScaffold(
Widget scaffold) → Widget -
Hook to decorate the scaffold returned by
scaffoldWidget.inherited -
deleteMultipleItems(
List< T> items) → void - Dispatches a remove-multiple-items event.
-
deselectMultipleItems(
List< T> items) → void - Dispatches a deselect-multiple-items event.
-
didChangeDependencies(
) → void -
Called when a dependency of this State object changes.
inherited
-
didUpdateWidget(
covariant W oldWidget) → void -
Called whenever the widget configuration changes.
inherited
-
displaySnackBar(
BuildContext context, String message, String? title, BlocXSnackbarType snackbarType) → void -
Shows a
BlocxSnackBarwith the given parameters.inherited -
dispose(
) → void -
Called when this object is removed from the tree permanently.
override
-
emptyWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget - Builds the empty-state widget.
-
errorWidget(
BuildContext context, ScreenManagerCubitStateDisplayErrorPage state) → Widget -
Builds the full-page error widget for
ScreenManagerCubitStateDisplayErrorPage.inherited -
errorWidgetByErrorCode(
BuildContext context, ScreenManagerCubitStateDisplayErrorPageByErrorCode state) → Widget -
Builds the full-page error widget for
ScreenManagerCubitStateDisplayErrorPageByErrorCode.inherited -
initState(
) → void - Called when this object is inserted into the tree.
-
itemBuilder(
BuildContext context, T item) → Widget -
Builds one visual item for
item. -
loadingWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget - Builds the loading widget.
-
loadMoreWidgetBuilder(
BuildContext context, bool isLoadingMore) → Widget? - Builds a custom load-more indicator widget.
-
loadNextPage(
) → void - Dispatches a load-next-page event.
-
mainWidget(
BuildContext context, ScreenManagerCubitState state) → Widget - The primary screen content.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onSelectionChanged(
BuildContext context, SelectionChangedData< T> selectionData) → void - Called when the collection selection changes.
-
reassemble(
) → void -
Called whenever the application is reassembled during debugging, for
example during hot reload.
inherited
-
refreshData(
) → void - Dispatches a refresh event.
-
refreshWidgetBuilder(
BuildContext context, double swipeRefreshHeight) → Widget? - Builds a custom refresh indicator widget.
-
scaffoldWidget(
BuildContext context, Widget body) → Widget -
Wraps
bodyin a Scaffold.inherited -
scrollToItem(
T item, {bool highlightItem = false}) → void -
Scrolls to
item. -
search(
String text) → void -
Dispatches a search event with
text. -
separatorBuilder(
BuildContext context, int index) → Widget - Builds a separator between list items.
-
setScrollController(
) → void - Creates or attaches the scroll controller used by the collection.
-
setState(
VoidCallback fn) → void -
Notify the framework that the internal state of this object has changed.
inherited
-
sliverBottomWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget? - Optional sliver displayed below sliver collections.
-
sliverTopWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget? - Optional sliver displayed above sliver collections.
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
topWidget(
BuildContext context, BlocxCollectionState< T> state) → Widget? - Optional widget displayed above the collection.
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited