StatefulDataView<T> class

A widget to display StatefulData according to its state.

StatefulDataView listens provided statefulData instance and updates the UI according to the data state.

When the data is ready, the builder function is used to display data view.

To display accompanying states, optional emptyView, errorBuilder, initialLoadingView, initialLoadingErrorView and loadingView parameters could be passed.

You can set common data state views for all StatefulDataView widgets by placing StatefulDataDefaultViews widget somewhere upper in the widget tree.

If some of those values are missed, then default views will be used for corresponding states.

See also:

Inheritance

Constructors

StatefulDataView({Key? key, required StatefulData<T> statefulData, required Widget builder(BuildContext context, T data), Widget? emptyView, Widget errorBuilder(BuildContext context, T? data, StatefulDataError? error)?, Widget? initialLoadingView, Widget? initialLoadingErrorView, Widget? loadingView})
Creates StatefulDataView widget.
const

Properties

builder Widget Function(BuildContext context, T data)
A function to build a widget that represent a provided data instance.
final
emptyView Widget?
A widget to display in case of empty data.
final
errorBuilder Widget Function(BuildContext context, T? data, StatefulDataError? error)?
A function that build a widget in case of error.
final
hashCode int
The hash code for this object.
no setterinherited
initialLoadingErrorView Widget?
A widget to display in case of initial data loading failed.
final
initialLoadingView Widget?
A widget to display during initial data loading.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingView Widget?
A widget to display during data loading.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statefulData StatefulData<T>
An instance of StatefulData of specified type.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _StatefulDataViewState<T>
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}) 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