dart:async
庫中Timer.cancel
方法的用法介紹如下。
用法:
void cancel()
取消定時器。
一旦 Timer 被取消,回調函數將不會被計時器調用。允許在 Timer 上多次調用 cancel,並且不會產生進一步的影響。
例子:
final timer =
Timer(const Duration(seconds: 5), () => print('Timer finished'));
// Cancel timer, callback never called.
timer.cancel();
相關用法
- Dart Timer.tick用法及代碼示例
- Dart Timer.periodic用法及代碼示例
- Dart Timer.run用法及代碼示例
- Dart Timer構造函數用法及代碼示例
- Dart Timer用法及代碼示例
- Dart Timeline用法及代碼示例
- Dart TransformList.last用法及代碼示例
- Dart TextTrackCueList.elementAt用法及代碼示例
- Dart TextTrackCueList.length用法及代碼示例
- Dart TouchList.elementAt用法及代碼示例
- Dart TextTrackList.first用法及代碼示例
- Dart TextTrackCueList.last用法及代碼示例
- Dart TouchList.length用法及代碼示例
- Dart TextTrackList.elementAt用法及代碼示例
- Dart TextTrackList.length用法及代碼示例
- Dart TransformList.elementAt用法及代碼示例
- Dart TouchList.first用法及代碼示例
- Dart TransformList.clear用法及代碼示例
- Dart TransformList.length用法及代碼示例
- Dart TextTrackList.last用法及代碼示例
- Dart TextTrackCueList.first用法及代碼示例
- Dart TransformList.first用法及代碼示例
- Dart TouchList.last用法及代碼示例
- Dart MapMixin.containsKey用法及代碼示例
- Dart Iterator用法及代碼示例
注:本文由純淨天空篩選整理自dart.dev大神的英文原創作品 cancel method。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。