What is the basic cookbook for a flutter widget that does this?
1) Displays initial state like "loading".
2) Async gets content from a REST API.
3) Updates state when the REST API returns success.
4) Refreshes content on a timer.
You may want to take a look here.
Generally speaking, you will have a StatefulWidget
that calls the API on it's initState
and store the "future" (async action in Dart) locally.
Then use FutureBuilder
to know weither or not the data is loading/fetched/error. And display something accordingly.