diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c732438a..9e6446b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [next] - Fix spriteAsWidget deprecation message +- Adding pause and resume methods to time class ## 0.27.0 - Improved the accuracy of the `FPSCounter` by using Flutter's internal frame timings. diff --git a/lib/time.dart b/lib/time.dart index 1fa3df0f2..6f02bac7d 100644 --- a/lib/time.dart +++ b/lib/time.dart @@ -48,6 +48,14 @@ class Timer { _running = false; } + void pause() { + _running = false; + } + + void resume() { + _running = true; + } + /// A value between 0 and 1 indicating the timer progress double get progress => _current / _limit; }