WhenRebuilderOr<T> class

Just like WhenRebuilder but you do not have to define all possible states.

Inheritance

Constructors

WhenRebuilderOr({Key? key, Widget onIdle()?, Widget onWaiting()?, Widget onError(dynamic error)?, Widget onData(T data)?, required Widget builder(BuildContext context, ReactiveModel<T> model), ReactiveModel<T> observe()?, List<ReactiveModel Function()>? observeMany, Object watch(ReactiveModel<T> model)?, 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>, WhenRebuilderOr<T>)?})
Just like WhenRebuilder but you do not have to define all possible states.
const

Properties

builder Widget Function(BuildContext context, ReactiveModel<T> model)
Widget to display if all the observed ReactiveModels has data or as the default case if any of the onIdle, onWaiting or onError is not defined
final
didUpdateWidget → (void Function(BuildContext, ReactiveModel<T>, WhenRebuilderOr<T>)?)
Called whenever the widget configuration changes.
final
dispose → (void Function(BuildContext, ReactiveModel<T>)?)
StateBuilderOr( dispose:(BuildContext context, ReactiveModel model) { myModel.dispose([context, model]); }, observe:()=> myModel1, onWaiting: ()=> ... onError: (error)=> ... builder: (context, reactiveModel)=> ... )
final
hashCode int
The hash code for this object.
no setterinherited
initState → (void Function(BuildContext, ReactiveModel<T>)?)
WhenRebuilderOr( initState:(BuildContext context, ReactiveModel model)=> myModel.init([context,model]), observe:()=> myModel1, onWaiting: ()=> ... onError: (error)=> ... builder: (context, reactiveModel)=> ... )
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
observe → (ReactiveModel<T> Function()?)
an observable class to which you want 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
watch → (Object Function(ReactiveModel<T> model)?)
callback to be executed before notifying listeners. It the returned value is the same as the last one, the rebuild process is interrupted.
final

Methods

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