EasyTimerCount.builder constructor

EasyTimerCount.builder({
  1. Key? key,
  2. required EasyTime duration,
  3. required Widget builder(
    1. String time
    )?,
  4. required FutureOr<void> onTimerStarts(
    1. BuildContext context
    ),
  5. required FutureOr<void> onTimerEnds(
    1. BuildContext context
    ),
  6. RankingType rankingType = RankingType.descending,
  7. SeparatorType? separatorType = SeparatorType.colon,
  8. bool resetTimer = false,
  9. EasyTimerController? controller,
  10. bool reCountAfterFinishing = false,
  11. FutureOr<void> onTimerRestart(
    1. BuildContext context,
    2. int countOfRestart
    )?,
})

Builder constructor for EasyTimerCount to allow custom rendering.

Implementation

EasyTimerCount.builder({
  super.key,
  required this.duration,
  required this.builder,
  required this.onTimerStarts,
  required this.onTimerEnds,
  this.rankingType = RankingType.descending,
  this.separatorType = SeparatorType.colon,
  this.resetTimer = false,
  this.controller,
  this.reCountAfterFinishing = false,
  this.onTimerRestart,
})  : timerColor = null,
      timerTextWeight = null,
      fontSize = null,
      wordSpacing = null,
      letterSpacing = null,
      decoration = null,
      backgroundColor = null,
      textDecorationStyle = null,
      fontFamily = null,
      locale = null,
      textOverflow = null,
      assert(duration.seconds.isNotEqualZero || duration.minutes.isNotEqualZero || duration.hours.isNotEqualZero),
      assert(
      (reCountAfterFinishing && (onTimerRestart.isNotNull || onTimerRestart.isNull))
          || (!reCountAfterFinishing && onTimerRestart.isNull)
      );