Adding pause and resume to timer

This commit is contained in:
Tyemy Kuga
2020-10-21 22:57:54 -03:00
parent 0958d5e0ba
commit 19dbda5354
2 changed files with 9 additions and 0 deletions

View File

@@ -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.

View File

@@ -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;
}