I have a function that returns a Future of the type duration.
Future loadur(TimerService timerservice) async {
var dur = Duration.zero;
dur = await timerservice.currentDuration();
return dur;}
The future takes duration from a timerservice which updates itself to run a timer.Now i want the future to be converted to a stream so i can show it in a StreamBuilder(Futurebuilder doesn't update the timer).
Any way to convert the future to a stream of duration will be helpful.
you can Use Stream.fromFuture(dur)
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