TimerUtil class

Constructors

TimerUtil({int duration = Duration.millisecondsPerSecond, OnTimerCallback? callback})
TimerUtil.countDown(int duration, int totalTime, OnTimerCallback? callback)

Properties

callback OnTimerCallback?
定时器回调
getter/setter pair
duration int
定时器每隔多久运行的时间,单位毫秒,默认1000毫秒(1秒)
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalTime int
倒计时总时间 单位毫秒
getter/setter pair

Methods

cancelTimer() → void
取消计时器
isActive() bool
定时器是否启动
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startCountDown() → void
启动倒计时定时器
startTimer() → void
启动定时器
toString() String
A string representation of this object.
inherited
updateTotalTime(int totalTime) → void
重设倒计时总时间

Operators

operator ==(Object other) bool
The equality operator.
inherited