pingbird / async_builder

Improved asyncronous builder for Flutter.
https://pub.dev/packages/async_builder
BSD 3-Clause "New" or "Revised" License
17 stars 2 forks source link

Refresh #1

Open gazialankus opened 3 years ago

gazialankus commented 3 years ago

I really like the idea of InitBuilder, which saves us from writing code in initState.

However, how would one go about refreshing the data? For example, I load a list in InitBuilder's getter and user sees the list. User then does a pull to refresh. Normally, with a FutureBuilder I would reassign the future variable that was used. How can I achieve such a refresh with InitBuilder?

One idea that comes to mind is to provide a dummy arg that is increased in setState every time user refreshes. Would that work? Is there a better way?

cuong292 commented 3 years ago

set the future, stream as new instance like : setState{() (future = Future()) } ( sthing like this)