I am a complete Flutter begginer. When screen loads for initial time, the data is correctly loaded with getOnlineClass() function. But when I try to update the value of UI, the new data is loaded but the UI does not update.
return RefreshIndicator(
onRefresh: () {
return dataLoader.loadOnlineClass().then((value) => (value){
print(value);
listDummy = PersistenceHelper().getOnlineClass();
setState(() {
print(listDummy.toString());
});
});
},
child: FutureBuilder(
future: listDummy, // async work
builder: (BuildContext context, AsyncSnapshot snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Text('Loading....');
default:
if (snapshot.hasError)
return Text('Error: ${snapshot.error}');
else
// print(snapshot.data);
return _listShowerTest(snapshot.data);
}
},
),
);