mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: later page: multi select
feat: fav detail page: multi select opt: reply item opt: load more Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -36,6 +36,7 @@ class SearchPanelController extends CommonController {
|
||||
searchResultController.count[SearchType.values.indexOf(searchType!)] =
|
||||
response.response.numResults;
|
||||
if (response.response.list != null) {
|
||||
isEnd = response.response.list.isEmpty;
|
||||
if (currentPage != 1 && loadingState.value is Success) {
|
||||
response.response.list
|
||||
?.insertAll(0, (loadingState.value as Success).response);
|
||||
@@ -45,6 +46,7 @@ class SearchPanelController extends CommonController {
|
||||
onPushDetail(response.response.list);
|
||||
}
|
||||
} else {
|
||||
isEnd = true;
|
||||
if (currentPage == 1) {
|
||||
loadingState.value = LoadingState.success([]);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:PiliPalaX/common/widgets/refresh_indicator.dart';
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/pages/search_panel/widgets/video_panel.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/common/skeleton/media_bangumi.dart';
|
||||
@@ -49,21 +48,6 @@ class _SearchPanelState extends State<SearchPanel>
|
||||
),
|
||||
tag: widget.searchType!.type + widget.keyword!,
|
||||
);
|
||||
_searchPanelController.scrollController.addListener(() async {
|
||||
if (_searchPanelController.scrollController.position.pixels >=
|
||||
_searchPanelController.scrollController.position.maxScrollExtent -
|
||||
100) {
|
||||
EasyThrottle.throttle('history', const Duration(seconds: 1), () {
|
||||
_searchPanelController.onLoadMore();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchPanelController.scrollController.removeListener(() {});
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -142,7 +126,7 @@ class _SearchPanelState extends State<SearchPanel>
|
||||
loadingState,
|
||||
);
|
||||
default:
|
||||
return const SizedBox();
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,9 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) {
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
searchPanelCtr.onLoadMore();
|
||||
}
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed('/htmlRender', parameters: {
|
||||
|
||||
@@ -29,6 +29,9 @@ Widget searchLivePanel(BuildContext context, ctr, LoadingState loadingState) {
|
||||
),
|
||||
itemCount: loadingState.response.length,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
ctr.onLoadMore();
|
||||
}
|
||||
return LiveItem(liveItem: loadingState.response[index]);
|
||||
},
|
||||
)
|
||||
|
||||
@@ -31,6 +31,9 @@ Widget searchBangumiPanel(context, ctr, LoadingState loadingState) {
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
ctr.onLoadMore();
|
||||
}
|
||||
var i = loadingState.response[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
|
||||
@@ -91,6 +91,9 @@ Widget searchUserPanel(context, searchPanelCtr, LoadingState loadingState) {
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
searchPanelCtr.onLoadMore();
|
||||
}
|
||||
var i = loadingState.response[index];
|
||||
String heroTag = Utils.makeHeroTag(i!.mid);
|
||||
return InkWell(
|
||||
|
||||
@@ -102,6 +102,9 @@ Widget searchVideoPanel(context, ctr, LoadingState loadingState) {
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
if (index == loadingState.response.length - 1) {
|
||||
ctr.onLoadMore();
|
||||
}
|
||||
return VideoCardH(
|
||||
videoItem: loadingState.response[index],
|
||||
showPubdate: true,
|
||||
|
||||
Reference in New Issue
Block a user