Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/timer_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class CountdownController {
/// ```
///
bool? isCompleted;

String state = 'paused';

/// if timer auto start.
final bool autoStart;
Expand All @@ -42,6 +44,7 @@ class CountdownController {
/// Run timer
///
start() {
state = 'started';
if (this.onStart != null) {
this.onStart!();
}
Expand All @@ -56,6 +59,7 @@ class CountdownController {
/// Set timer in pause
///
pause() {
state = 'paused';
if (this.onPause != null) {
this.onPause!();
}
Expand All @@ -70,6 +74,7 @@ class CountdownController {
/// Resume from pause
///
resume() {
state = 'resumed';
if (this.onResume != null) {
this.onResume!();
}
Expand All @@ -84,6 +89,7 @@ class CountdownController {
/// Restart timer from cold
///
restart() {
state = 'started';
if (this.onRestart != null) {
this.onRestart!();
}
Expand Down