In my network function I use showDialog() to show progress dialog when the network call is happening, but I also need the RefreshIndicator to have the pull-to-refresh.
When I pull down on ListView, the RefreshProgressIndicator is shown, and when I let go, the onRefresh method is called which loads my networkCall function which shows my own progress dialog, and the RefreshProgressIndicator is still loading behind the progress dialog, which is expected.
So is there a way to hide/stop the RefreshProgressIndicator so that it is not loading behind the my progress dialog?
Future<void> networkCall() async {
showDialog();
await apiCall();
hideDialog();
setState((){...}):
}
RefreshIndicator(
onRefresh: networkCall,
child: ListView.builder(),
)
I need my own showDialog() to show the loading process. So how do I hide the RefreshProgressIndicator when onRefresh is called?