From 4b51cea91b0cae9b44a0a02ebc4b4f219660143a Mon Sep 17 00:00:00 2001 From: Jonas Finnemann Jensen Date: Wed, 21 Nov 2018 10:54:59 +0000 Subject: [PATCH] More docs for Timer.cancel() Notably, it's worth documenting that calling `cancel()` twice is safe. Change-Id: I35fdf3f8a810f78f296fc96750ec9ad4d81c6fc7 Reviewed-on: https://dart-review.googlesource.com/c/83744 Commit-Queue: Jonas Jensen Auto-Submit: Jonas Jensen Reviewed-by: Martin Kustermann Reviewed-by: Lasse R.H. Nielsen --- sdk/lib/async/timer.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/lib/async/timer.dart b/sdk/lib/async/timer.dart index 186bbe62abf3..aa2f08864e04 100644 --- a/sdk/lib/async/timer.dart +++ b/sdk/lib/async/timer.dart @@ -89,6 +89,10 @@ abstract class Timer { /** * Cancels the timer. + * + * Once a [Timer] has been canceled, the callback function will not be called + * by the timer. Calling [cancel] more than once on a [Timer] is allowed, and + * will have no further effect. */ void cancel();