Why doesn't Timer.run() return a Future? I am running some code inside the run() call which may throw an exception and if it doesn't return a future how can I add a catchError() on to it?
Why not use Future.delayed for this use case? This would give you a future that completes after a certain period of time. I'm guessing that's what you're trying to achieve by putting your code inside Timer.run.
You can find an example of how to use Future.delayed here.
You may also find Dart docs about Future useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With