StateBuilder<T> class

One of the three observer widgets in states_rebuilder

See WhenRebuilder, WhenRebuilderOr

Inheritance

Constructors

StateBuilder({Key? key, Widget builder(BuildContext context, ReactiveModel<T>? model)?, ReactiveModel<T> observe()?, List<ReactiveModel Function()>? observeMany, Widget builderWithChild(BuildContext context, ReactiveModel<T>? model, Widget child)?, Widget? child, dynamic onSetState(BuildContext context, ReactiveModel<T>? model)?, void onRebuildState(BuildContext context, ReactiveModel<T>? model)?, Object? watch(SnapState<T>? model)?, bool shouldRebuild(SnapState<T>? model)?, void initState(BuildContext context, ReactiveModel<T>? model)?, void dispose(BuildContext context, ReactiveModel<T>? model)?, void didChangeDependencies(BuildContext context, ReactiveModel<T>? model)?, void didUpdateWidget(BuildContext context, ReactiveModel<T>? model, StateBuilder<T> oldWidget)?, void afterInitialBuild(BuildContext context, ReactiveModel<T>? model)?})
One of the three observer widgets in states_rebuilder
const

Properties

afterInitialBuild → void Function(BuildContext context, ReactiveModel<T>? model)?
Called after the widget is first inserted in the widget tree.
final
builder Widget Function(BuildContext context, ReactiveModel<T>? model)?
StateBuilder( models:[myModel], builder:(BuildContext context, ReactiveModel model) =>MyWidget(), )
final
builderWithChild Widget Function(BuildContext context, ReactiveModel<T>? model, Widget child)?
StateBuilder( models:[myModel], builderWithChild:(BuildContext context, ReactiveModel model, Widget child) =>MyWidget(child), child : MyChildWidget(), )
final
child Widget?
The child to be used in builderWithChild.
final
didChangeDependencies → void Function(BuildContext context, ReactiveModel<T>? model)?
StateBuilder( didChangeDependencies:(BuildContext context, ReactiveModel model) { //...your code }, models:[myModel], builder:(BuildContext context, ReactiveModel model) =>MyWidget(), )
final
didUpdateWidget → void Function(BuildContext context, ReactiveModel<T>? model, StateBuilder<T> oldWidget)?
StateBuilder( didUpdateWidget:(BuildContext context, ReactiveModel model,StateBuilder oldWidget) { myModel.dispose([context, model]); }, models:[myModel], builder:(BuildContext context, ReactiveModel model) =>MyWidget(), )
final
dispose → void Function(BuildContext context, ReactiveModel<T>? model)?
StateBuilder( dispose:(BuildContext context, ReactiveModel model) { myModel.dispose([context, model]); }, models:[myModel], builder:(BuildContext context, ReactiveModel model) =>MyWidget(), )
final
hashCode int
The hash code for this object.
no setterinherited
initState → void Function(BuildContext context, ReactiveModel<T>? model)?
A tag or list of tags you want this StateBuilder to register with.
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 StateBuilder to subscribe.
final
observeMany List<ReactiveModel Function()>?
List of observable classes to which you want StateBuilder to subscribe.
final
onRebuildState → void Function(BuildContext context, ReactiveModel<T>? model)?
Called whenever this widget is notified and after rebuilding the widget.
final
onSetState → dynamic Function(BuildContext context, ReactiveModel<T>? model)?
Called whenever this widget is notified.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldRebuild bool Function(SnapState<T>? model)?
Callback to determine whether this StateBuilder will rebuild or not.
final
watch Object? Function(SnapState<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() State<StateBuilder<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