mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: fav search
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -52,13 +52,17 @@ class FavSearchController extends CommonController {
|
||||
List? dataList = searchType == SearchType.fav
|
||||
? (currentPage == 1
|
||||
? response.response.medias
|
||||
: currentList + response.response.medias)
|
||||
: response.response.medias != null
|
||||
? currentList + response.response.medias
|
||||
: currentList)
|
||||
: (currentPage == 1
|
||||
? response.response.list
|
||||
: currentList + response.response.list);
|
||||
: response.response.list != null
|
||||
? currentList + response.response.list
|
||||
: currentList);
|
||||
isEnd = searchType == SearchType.fav
|
||||
? response.response.hasMore == false
|
||||
: response.response.list.isEmpty;
|
||||
: response.response.list == null || response.response.list.isEmpty;
|
||||
loadingState.value = LoadingState.success(dataList);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -123,6 +123,9 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
)
|
||||
: _favSearchCtr.searchType == SearchType.follow
|
||||
? ListView.builder(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 80,
|
||||
),
|
||||
controller: _favSearchCtr.scrollController,
|
||||
itemCount: loadingState.response.length,
|
||||
itemBuilder: ((context, index) {
|
||||
@@ -138,24 +141,29 @@ class _FavSearchPageState extends State<FavSearchPage> {
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
controller: _favSearchCtr.scrollController,
|
||||
slivers: [
|
||||
SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).padding.bottom + 80,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
_favSearchCtr.onLoadMore();
|
||||
}
|
||||
return HistoryItem(
|
||||
videoItem: loadingState.response[index],
|
||||
ctr: _favSearchCtr,
|
||||
onChoose: null,
|
||||
);
|
||||
},
|
||||
childCount: loadingState.response.length,
|
||||
sliver: SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: 2,
|
||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
_favSearchCtr.onLoadMore();
|
||||
}
|
||||
return HistoryItem(
|
||||
videoItem: loadingState.response[index],
|
||||
ctr: _favSearchCtr,
|
||||
onChoose: null,
|
||||
);
|
||||
},
|
||||
childCount: loadingState.response.length,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user