restartCount property

int restartCount

当前任务是第几次重启

0表示首次用户调用Work.start的正常启动执行,大于0表示当前是第几次重新启动任务。

Work.onSuccessful,Work.onFailed,Work.onCanceled,Work.onFinished中有返回true时将会重新执行Work.start, 并且重新执行的Work生命周期中的data句柄中此变量会加1。

Implementation

int get restartCount => _restartCount;