Skip to content

Commit

Permalink
fix: update readme example initstate
Browse files Browse the repository at this point in the history
  • Loading branch information
clragon committed Oct 28, 2024
1 parent 2e2fb53 commit 3e313e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class _BeerListViewState extends State<BeerListView> {
@override
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
super.initState();
}
Future<void> _fetchPage(int pageKey) async {
Expand Down
12 changes: 6 additions & 6 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class _BeerListViewState extends State<BeerListView> {
@override
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
super.initState();
}
Future<void> _fetchPage(int pageKey) async {
Expand Down Expand Up @@ -191,11 +191,10 @@ class _BeerSliverListState extends State<BeerSliverList> {
@override
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
super.initState();
}
Future<void> _fetchPage(pageKey) async {
Expand Down Expand Up @@ -285,6 +284,8 @@ If you need to execute some custom action when the list status changes, such as
```dart
@override
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) {
_fetchPage(pageKey);
});
Expand All @@ -304,8 +305,6 @@ void initState() {
);
}
});
super.initState();
}
```

Expand Down Expand Up @@ -337,6 +336,8 @@ class _BeerSliverGridState extends State<BeerSliverGrid> {
@override
void initState() {
super.initState();
_pagingController.addPageRequestListener((pageKey) {
_bloc.onPageRequestSink.add(pageKey);
});
Expand All @@ -353,7 +354,6 @@ class _BeerSliverGridState extends State<BeerSliverGrid> {
itemList: listingState.itemList,
);
});
super.initState();
}
@override
Expand Down

0 comments on commit 3e313e1

Please sign in to comment.