6

How do I watch the Timer Duration to do something after a specific number of minutes/seconds before it ends? var duration = Duration(seconds: time); Which will end in an hour. I want for example when time passed 30 minutes call a function OR anything else.

1
  • Unclear, can you provide an example? Commented Aug 22, 2018 at 15:27

1 Answer 1

13

You can use Future.delayed(...)

new Future.delayed(const Duration(seconds: time), () {
  // deleayed code here 
  print('delayed execution');
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.