mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 08:38:37 +00:00
opt: common ctr
opt: state Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -70,20 +70,20 @@ class LiveController extends CommonListController {
|
||||
Future<LoadingState> customGetData() {
|
||||
if (areaIndex.value != 0) {
|
||||
return LiveHttp.liveSecondList(
|
||||
pn: currentPage,
|
||||
pn: page,
|
||||
isLogin: isLogin.value,
|
||||
areaId: areaId,
|
||||
parentAreaId: parentAreaId,
|
||||
sortType: sortType,
|
||||
);
|
||||
}
|
||||
return LiveHttp.liveFeedIndex(pn: currentPage, isLogin: isLogin.value);
|
||||
return LiveHttp.liveFeedIndex(pn: page, isLogin: isLogin.value);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onRefresh() {
|
||||
count = null;
|
||||
currentPage = 1;
|
||||
page = 1;
|
||||
isEnd = false;
|
||||
if (areaIndex.value != 0) {
|
||||
queryTop();
|
||||
@@ -93,7 +93,7 @@ class LiveController extends CommonListController {
|
||||
|
||||
Future<void> queryTop() async {
|
||||
final res = await LiveHttp.liveFeedIndex(
|
||||
pn: currentPage,
|
||||
pn: page,
|
||||
isLogin: isLogin.value,
|
||||
moduleSelect: true,
|
||||
);
|
||||
@@ -124,7 +124,7 @@ class LiveController extends CommonListController {
|
||||
parentAreaId = cardLiveItem?.areaV2ParentId;
|
||||
|
||||
count = null;
|
||||
currentPage = 1;
|
||||
page = 1;
|
||||
isEnd = false;
|
||||
queryData();
|
||||
}
|
||||
@@ -134,7 +134,7 @@ class LiveController extends CommonListController {
|
||||
this.sortType = sortType;
|
||||
|
||||
count = null;
|
||||
currentPage = 1;
|
||||
page = 1;
|
||||
isEnd = false;
|
||||
queryData();
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
||||
childCount: 10,
|
||||
),
|
||||
),
|
||||
Success() => SliverMainAxisGroup(
|
||||
Success(:var response) => SliverMainAxisGroup(
|
||||
slivers: [
|
||||
if (controller.newTags?.isNotEmpty == true)
|
||||
SliverToBoxAdapter(
|
||||
@@ -183,7 +183,7 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
||||
itemCount: controller.newTags!.length,
|
||||
),
|
||||
),
|
||||
loadingState.response?.isNotEmpty == true
|
||||
response?.isNotEmpty == true
|
||||
? SliverGrid(
|
||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||
mainAxisSpacing: StyleString.cardSpace,
|
||||
@@ -195,10 +195,10 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) {
|
||||
if (index == loadingState.response!.length - 1) {
|
||||
if (index == response.length - 1) {
|
||||
controller.onLoadMore();
|
||||
}
|
||||
final item = loadingState.response![index];
|
||||
final item = response[index];
|
||||
if (item is LiveCardList) {
|
||||
return LiveCardVApp(
|
||||
item: item.cardData!.smallCardV1!,
|
||||
@@ -206,14 +206,14 @@ class _LivePageState extends CommonPageState<LivePage, LiveController>
|
||||
}
|
||||
return LiveCardVApp(item: item);
|
||||
},
|
||||
childCount: loadingState.response!.length,
|
||||
childCount: response!.length,
|
||||
),
|
||||
)
|
||||
: HttpError(onReload: controller.onReload),
|
||||
],
|
||||
),
|
||||
Error() => HttpError(
|
||||
errMsg: loadingState.errMsg,
|
||||
Error(:var errMsg) => HttpError(
|
||||
errMsg: errMsg,
|
||||
onReload: controller.onReload,
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user