TimerControllerBuilder class

TimerControllerBuilder handles building a widget in response to new value. Please refer to TimerControllerListener if you want to "do" anything in response to value changes such as navigation, showing a dialog, etc...

TimerControllerBuilder(
  controller: myTimerController,
  builder: (context, value, child) {
  // return widget here based on myTimerController
  }
)

An optional buildWhen can be implemented for more granular control over how often TimerControllerBuilder rebuilds. buildWhen will be invoked on each controller value change. buildWhen takes the previous and current value and must return a bool which determines whether or not the builder function will be invoked. The previous value will be initialized to the value of the controller when the TimerControllerBuilder is initialized. buildWhen is optional and if omitted, it will default to true.

TimerControllerBuilder(
  controller: myTimerController,
  buildWhen: (previous, current) {
    // return true/false to determine whether or not
    // to rebuild the widget with state
  },
  builder: (context, value, child) {
    // return widget here based on myTimerController value
  }
)
Inheritance

Constructors

TimerControllerBuilder({required TimerControllerWidgetBuilder builder, required TimerController controller, TimerControllerBuilderCondition? buildWhen, Widget? child, Key? key})
const

Properties

builder TimerControllerWidgetBuilder
The builder function which will be invoked on each widget build. The builder takes the BuildContext the current value and a child and must return a widget.
final
buildWhen TimerControllerBuilderCondition?
An optional buildWhen can be implemented for more granular control over how often TimerControllerBuilder rebuilds. buildWhen will be invoked on each controller value change. buildWhen takes the previous and current value and must return a bool which determines whether or not the builder function will be invoked. The previous value will be initialized to the value of the controller when the TimerControllerBuilder is initialized. buildWhen is optional and if omitted, it will default to true.
final
child Widget?
The widget below in the tree.
final
controller TimerController
The TimerController that will be listened.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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