Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
fix: 検索結果の追加読み込み発火条件を変更
Browse files Browse the repository at this point in the history
コンテンツ全体の0.8倍までスクロールした時点で追加読み込みを行うように変更
  • Loading branch information
YumNumm authored Nov 14, 2022
1 parent f0a38dd commit 8ee9b6e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ui/page/search_view/component/repository_search_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ class RepositorySearchList extends ConsumerWidget {
if (!data.hasValue) {
return false;
}
if (notification.metrics.extentAfter == 0 &&

final scrollPosition = notification.metrics.pixels / notification.metrics.maxScrollExtent;


if (scrollPosition > 0.8 &&
(data.value!.isNotEmpty)) {
// 既に検索結果を全て読み込んでいる場合は、
// 次のページを読み込む処理を行わない
if (data.value!.length ==
(ref.read(totalRepositoryCountProvider).value ?? 0)) {
return true;
return false;
}
ref
.read(repositorySearchViewModel.notifier)
Expand Down

0 comments on commit 8ee9b6e

Please sign in to comment.