Reputation: 335
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.
Upvotes: 19
Views: 21863