WhenRebuilder<T> class

a combination of StateBuilder widget and ReactiveModel.whenConnectionState method. It Exhaustively switch over all the possible statuses of ReactiveModel.connectionState

Inheritance

Constructors

WhenRebuilder({Key? key, required Widget onIdle(), required Widget onWaiting(), required Widget onError(dynamic error), required Widget onData(T data), ReactiveModel<T> observe()?, List<ReactiveModel Function()>? observeMany, bool shouldRebuild(ReactiveModel<T>)?, void initState(BuildContext, ReactiveModel<T>)?, void dispose(BuildContext, ReactiveModel<T>)?, dynamic onSetState(BuildContext context, ReactiveModel<T> model)?, void didUpdateWidget(BuildContext, ReactiveModel<T>, WhenRebuilder<T>)?})
a combination of StateBuilder widget and ReactiveModel.whenConnectionState method. It Exhaustively switch over all the possible statuses of ReactiveModel.connectionState
const

Properties

didUpdateWidget → (void Function(BuildContext, ReactiveModel<T>, WhenRebuilder<T>)?)
Called whenever the widget configuration changes.
final
dispose → (void Function(BuildContext, ReactiveModel<T>)?)
StateBuilder( dispose:(BuildContext context, ReactiveModel model) { myModel.dispose([context, model]); }, observe:()=> myModel1, onIdle: ()=> ... onWaiting: ()=> ... onError: (error)=> ... onData: (data)=> ... )
final
hashCode int
The hash code for this object.
no setterinherited
initState → (void Function(BuildContext, ReactiveModel<T>)?)
WhenRebuilder( initState:(BuildContext context, ReactiveModel model)=> myModel.init([context,model]), observe:()=> myModel1, onIdle: ()=> ... onWaiting: ()=> ... onError: (error)=> ... onData: (data)=> ... )
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
observe → (ReactiveModel<T> Function()?)
List of observable classes to which you want this WhenRebuilder to subscribe.
final
observeMany List<ReactiveModel Function()>?
List of observable classes to which you want this WhenRebuilder to subscribe.
final
onData Widget Function(T data)
Widget to display if all the observed ReactiveModels has data.
final
onError Widget Function(dynamic error)
Widget to display when the at least on of the observed ReactiveModels has an error.
final
onIdle Widget Function()
Widget to display when the widget is first rendered and before executing any method.
final
onSetState → (dynamic Function(BuildContext context, ReactiveModel<T> model)?)
Called whenever this widget is notified.
final
onWaiting Widget Function()
Widget to display when the at least on of the observed ReactiveModels is in the waiting state.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldRebuild → (bool Function(ReactiveModel<T>)?)
final

Methods

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