opt: common ctr

opt: state

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-11 12:21:42 +08:00
parent 5bff1747e6
commit 574bf861f0
129 changed files with 1065 additions and 1058 deletions

View File

@@ -14,22 +14,20 @@ class RcmdController extends CommonListController {
@override
void onInit() {
super.onInit();
currentPage = 0;
page = 0;
queryData();
}
@override
Future<LoadingState> customGetData() {
return appRcmd
? VideoHttp.rcmdVideoListApp(freshIdx: currentPage)
: VideoHttp.rcmdVideoList(freshIdx: currentPage, ps: 20);
? VideoHttp.rcmdVideoListApp(freshIdx: page)
: VideoHttp.rcmdVideoList(freshIdx: page, ps: 20);
}
@override
void handleListResponse(List dataList) {
if (enableSaveLastData &&
currentPage == 0 &&
loadingState.value is Success) {
if (enableSaveLastData && page == 0 && loadingState.value is Success) {
List? currentList = (loadingState.value as Success).response;
if (currentList?.isNotEmpty == true) {
if (savedRcmdTip) {
@@ -45,7 +43,7 @@ class RcmdController extends CommonListController {
@override
Future<void> onRefresh() {
currentPage = 0;
page = 0;
isEnd = false;
return queryData();
}