TimeBuilder constructor

const TimeBuilder({
  1. Key? key,
  2. required TimeBuilderBuilder builder,
  3. required IfShouldTickAndRebuild ifShouldTickAndRebuild,
  4. IsFinished? isFinished,
})

Creates a TimeBuilder.

  • Function ifShouldTickAndRebuild will be called for every frame, repeatedly. Whenever it returns true, 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 as Visibility.

  • If function isFinished is provided, the ticking will stop definitively (and ifShouldTickAndRebuild won't be called anymore) when it returns true.

  • The builder will 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);