Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Would be nice to have onCompleted to take action when the counter reaches the end #20

Closed
Sureya opened this issue Dec 30, 2022 · 2 comments

Comments

@Sureya
Copy link

Sureya commented Dec 30, 2022

When the counter reaches the end its still in CustomTimerState.counting. I would like to take action and update certain state values once the clock hits 00:00:00. What would be the best way to do that please?

@federicodesia
Copy link
Owner

Hi! I recently updated this package fixing some of these issues.
I recommend you read the README to see the new way it works after certain important changes.

Now when the timer reaches the end the state changes to CustomTimerState.finished
You can also listen for these state changes like this:

_controller.state.addListener(() {
  final state = _controller.state.value;
  if(state == CustomTimerState.finished) // Take an action
});

@Sureya
Copy link
Author

Sureya commented Jan 15, 2023

Many thanks for this update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants