ObserverFuture<D, E> class

Inheritance

Constructors

ObserverFuture({Key? key, required ObservableFuture? observableFuture()?, required Widget onData(BuildContext context, D data), Widget onNull(BuildContext context)?, VoidCallback? fetchData, Widget onPending(BuildContext context)?, Widget onError(BuildContext context, E error)?, Widget onUnstarted(BuildContext context)?, bool showDefaultProgressInOverlay = false, bool showDefaultProgressInWidget = false, Color? progressOverlayColor, String? reloadButtonText, Color? progressOverlayBgColor, Widget? overlayWidget, Transition? transition, int retry = 0, bool autoInitialize = true, void listen(ObservableFuture?)?})

Properties

autoInitialize bool
If true, it will try to call fetchData callback autoInitialize default is true
final
fetchData VoidCallback?
If fetchData is filled, it will be called just once on initState.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listen → (void Function(ObservableFuture?)?)
Executed on every event changes
final
observableFuture → (ObservableFuture? Function()?)
observableFuture
final
onData Widget Function(BuildContext context, D data)
the data property has the value of ObservableFuture, and it may be null eventually. You can handle null value on onData callback or just enter a onNull callback to handle null values separately. Note, if you set a onNull callback, the onData will not be triggered if value == null.
final
onError → (Widget Function(BuildContext context, E error)?)
onError callback
final
onNull → (Widget Function(BuildContext context)?)
onNull callback
final
onPending → (Widget Function(BuildContext context)?)
onPending callback
final
onUnstarted → (Widget Function(BuildContext context)?)
onUnstarted callback
final
overlayWidget Widget?
Required to inform showDefaultProgressInOverlay = true in order to show that widget on onPending event This widget will be shown over the entire screen
final
progressOverlayBgColor Color?
Overlay onPending Background color (if showDefaultProgressInOverlay is enabled)
final
progressOverlayColor Color?
Overlay onPending circular progress indicator color (if showDefaultProgressInOverlay is enabled)
final
reloadButtonText String?
Required to inform fetchData in order to show that button on error events
final
retry int
if it get some exception, it will try to call fetchData again
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showDefaultProgressInOverlay bool
Show CircularProgressIndicator over the entire app and lock taps on screen, while status == pending
final
showDefaultProgressInWidget bool
Show CircularProgressIndicator while status == pending Warning: onPending overrides this
final
transition Transition?
final

Methods

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