TimeBuilder constructor
const
TimeBuilder({
- Key? key,
- required TimeBuilderBuilder builder,
- required IfShouldTickAndRebuild ifShouldTickAndRebuild,
- IsFinished? isFinished,
Creates a TimeBuilder.
-
Function
ifShouldTickAndRebuildwill be called for every frame, repeatedly. Whenever it returnstrue, the TimeBuilder will "tick" and rebuild. Note this function stops being called temporarily when the widget is in a route that is not visible, or because of an ancestor widget such asVisibility. -
If function
isFinishedis provided, the ticking will stop definitively (andifShouldTickAndRebuildwon't be called anymore) when it returnstrue. -
The
builderwill be called for each tick, and should return the widget to be built. Not the builder gets the current time, the initial time, the number of ticks elapsed since the TimeBuilder was created, and a flag indicating if the ticking is finished.
Implementation
const TimeBuilder({
Key? key,
required this.builder,
required this.ifShouldTickAndRebuild,
this.isFinished,
}) : super(key: key);