Flutter ListView BLoC pull & refresh
Step by step to add pull-to-refresh to any `ListView` and connect to to the BLoC
This is a continuation for the first post Flutter BLoC & GraphQL
I will modify the code in ./lib/screens/home/home_screen.dart to add pull-to-refresh functionality.
Make it Stateful Make the HomeScreen class extends StatefulWidget
Converting a StatelessWidget to StatefulWidget is just a click away thanks to the Flutter extension for IntelliJ & VSCode.
Track the list of posts Create a variable in the _HomeScreenState class to hold the list of posts, List<GetPosts$Query$Post> _posts = [];.
[Read More]