Flutter listview not updating after data update after network request using http.get or http.post. Here we will see how to update the data listview once you post data to the server or get data from the server.
If you are not able to update the data after http request, then you this is the right tutorial for you.
If you want to get back your data after posting or after http.get(), you need to use async and await around the caller function.
_loadData() async {
await Get.find<DataController>().getData();
}
Then call _loadData() from your initState or build method.
Reason
If you don’t use await and async, your build method wont’ wait to get the data and would just go ahead rebuild the ui, So you need to wait until data arrives or became available to the ui.