EasyTimerCount constructor

EasyTimerCount({
  1. Key? key,
  2. required EasyTime duration,
  3. required FutureOr<void> onTimerStarts(
    1. BuildContext context
    ),
  4. required FutureOr<void> onTimerEnds(
    1. BuildContext context
    ),
  5. RankingType rankingType = RankingType.descending,
  6. SeparatorType? separatorType = SeparatorType.colon,
  7. bool resetTimer = false,
  8. Color? timerColor,
  9. FontWeight? timerTextWeight,
  10. double? fontSize,
  11. double? wordSpacing,
  12. double? letterSpacing,
  13. TextDecoration? decoration,
  14. Color? backgroundColor,
  15. TextDecorationStyle? textDecorationStyle,
  16. String? fontFamily,
  17. Locale? locale,
  18. TextOverflow? textOverflow,
  19. EasyTimerController? controller,
  20. bool reCountAfterFinishing = false,
  21. FutureOr<void> onTimerRestart(
    1. BuildContext context,
    2. int countOfRestart
    )?,
})

Default constructor for EasyTimerCount.

Implementation

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