I assume the problem is caused by the response from the server arrives after the widget is disposed.
Check if the widget is mounted before you call setState
. This should prevent the error you are seeing:
// Before calling setState check if the state is mounted.
if (mounted) {
setState (() => _noDataText="No Data");
}