-
Notifications
You must be signed in to change notification settings - Fork 7
Update packages #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update packages #61
Changes from all commits
f1f87e2
21e3296
1dada8c
62c1dc5
ad5a74a
53939e3
fb60d07
7d8bc1e
945f483
1b737da
7435019
0b85a02
b749ed9
4925c09
aee32b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,9 +24,9 @@ mixin PaginationService<T extends StatefulWidget> on State<T> { | |
| /// _checkIfCanLoadMore(); | ||
| /// } | ||
| /// ``` | ||
| void listener() { | ||
| Future<void> listener() async { | ||
| if (scrollController.offset > scrollController.position.maxScrollExtent - 50) { | ||
| _checkIfCanLoadMore(); | ||
| await _checkIfCanLoadMore(); | ||
| } | ||
| } | ||
|
Comment on lines
+27
to
31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Async conversion is ineffective in this context. Two issues with this change:
The guard flags ( If the intent is to prevent multiple simultaneous load-more requests, consider:
Suggested pattern for actual async guard protection- void onEndScroll();
+ Future<void> onEndScroll();
- void onTopScroll() {}
+ Future<void> onTopScroll() async {}
Future<void> _checkIfCanLoadMore() async {
if (scrollController.position.pixels == 0) {
if (!_canFetchTop) return;
_canFetchTop = false;
- onTopScroll();
+ await onTopScroll();
_canFetchTop = true;
} else {
if (!_canFetchBottom) return;
_canFetchBottom = false;
- onEndScroll();
+ await onEndScroll();
_canFetchBottom = true;
}
}🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| // ignore_for_file: require_trailing_commas | ||
| import 'dart:async'; | ||
|
|
||
| import 'package:api_client/api_client.dart'; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.