OkitoBuilder<T extends OkitoController> class
OkitoBuilder is the easiest way to track state changes and re-render state on change.
Instead of having a stateful widget that re-renders on any change which causes all the dependencies to re-render no matter if they are changed or not, StatelessWidget with OkitoBuilder just re-renders where did you use OkitoBuilder. If your widget don't need a dynamic state, just don't put it inside builder. It won't re-built.
Example
OkitoBuilder(
controller: counterController,
builder: () => Text('${counterController.count}',
),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OkitoBuilder
Constructors
-
OkitoBuilder({Key? key, required T controller, List<
OkitoController> otherControllers = const [], required BuilderCallback builder, List<String> watchStorageKeys = const [], bool watchAllStorageKeys = false, bool activateLifecycleForOtherControllers = false, FilterCallback<T> ? filter}) -
OkitoBuilder is the way to use OkitoController.
const
Properties
- activateLifecycleForOtherControllers → bool
-
If you set this to true, whenever the builder disposes or activates
the initState and dispose functions will be called for all the
otherControllers. Be careful when using it.
final
- builder → BuilderCallback
-
Builder callback is called whenever your state changes.
final
- controller → T
-
controller should be a class that extends or mixs OkitoController.
final
-
filter
→ FilterCallback<
T> ? -
Filter of builder
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
otherControllers
→ List<
OkitoController> -
If you have more than one controller, you can create an array of
controllers.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- watchAllStorageKeys → bool
-
If you want to watch any change in OkitoStorage, make it true.
final
-
watchStorageKeys
→ List<
String> -
The OkitoStorage keys that you want to listen.
final
Methods
-
callFilter(
) → Object? - Filter of builder
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _OkitoBuilderState -
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