mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: footer
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -36,7 +36,7 @@ abstract class CommonController<R, T> extends GetxController
|
|||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
late bool isEnd = false;
|
late bool isEnd = false;
|
||||||
Rx<LoadingState> get loadingState;
|
Rx<LoadingState> get loadingState;
|
||||||
bool? isReply;
|
bool? hasFooter;
|
||||||
|
|
||||||
Future<LoadingState<R>> customGetData();
|
Future<LoadingState<R>> customGetData();
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ abstract class CommonController<R, T> extends GetxController
|
|||||||
isEnd = true;
|
isEnd = true;
|
||||||
if (isRefresh) {
|
if (isRefresh) {
|
||||||
loadingState.value = LoadingState<List<T>?>.success(dataList);
|
loadingState.value = LoadingState<List<T>?>.success(dataList);
|
||||||
} else if (isReply == true) {
|
} else if (hasFooter == true) {
|
||||||
loadingState.refresh();
|
loadingState.refresh();
|
||||||
}
|
}
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
|||||||
late bool hasUpTop = false;
|
late bool hasUpTop = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool? get isReply => true;
|
bool? get hasFooter => true;
|
||||||
|
|
||||||
late final antiGoodsReply = GStorage.antiGoodsReply;
|
late final antiGoodsReply = GStorage.antiGoodsReply;
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ class FavDetailController
|
|||||||
queryData();
|
queryData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool? get hasFooter => true;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<FavDetailItemData>? getDataList(FavDetailData response) {
|
List<FavDetailItemData>? getDataList(FavDetailData response) {
|
||||||
return response.list;
|
return response.list;
|
||||||
|
|||||||
@@ -91,27 +91,19 @@ class _OwnerFollowListState extends State<OwnerFollowList>
|
|||||||
? ListView.builder(
|
? ListView.builder(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
itemCount: followList.length + 1,
|
itemCount: followList.length,
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
bottom: MediaQuery.of(context).padding.bottom + 80,
|
||||||
|
),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == followList.length) {
|
return FollowItem(
|
||||||
return Container(
|
item: followList[index],
|
||||||
height:
|
ctr: widget.ctr,
|
||||||
MediaQuery.of(context).padding.bottom + 60,
|
callback: (attr) {
|
||||||
padding: EdgeInsets.only(
|
followList[index].attribute = attr == 0 ? -1 : 0;
|
||||||
bottom:
|
followList.refresh();
|
||||||
MediaQuery.of(context).padding.bottom),
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return FollowItem(
|
|
||||||
item: followList[index],
|
|
||||||
ctr: widget.ctr,
|
|
||||||
callback: (attr) {
|
|
||||||
followList[index].attribute =
|
|
||||||
attr == 0 ? -1 : 0;
|
|
||||||
followList.refresh();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: errorWidget(
|
: errorWidget(
|
||||||
|
|||||||
@@ -49,26 +49,25 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Success() => loadingState.response?.isNotEmpty == true
|
Success() => loadingState.response?.isNotEmpty == true
|
||||||
? SliverGrid(
|
? SliverPadding(
|
||||||
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
padding: EdgeInsets.only(
|
||||||
mainAxisSpacing: 2,
|
bottom: MediaQuery.of(context).padding.bottom,
|
||||||
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
|
||||||
childAspectRatio: StyleString.aspectRatio * 2.2,
|
|
||||||
),
|
),
|
||||||
delegate: SliverChildBuilderDelegate((context, index) {
|
sliver: SliverGrid(
|
||||||
if (index == loadingState.response!.length) {
|
gridDelegate: SliverGridDelegateWithExtentAndRatio(
|
||||||
return SizedBox(
|
mainAxisSpacing: 2,
|
||||||
height: MediaQuery.of(context).padding.bottom,
|
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
|
||||||
);
|
childAspectRatio: StyleString.aspectRatio * 2.2,
|
||||||
} else {
|
),
|
||||||
|
delegate: SliverChildBuilderDelegate((context, index) {
|
||||||
return VideoCardH(
|
return VideoCardH(
|
||||||
videoItem: loadingState.response![index],
|
videoItem: loadingState.response![index],
|
||||||
showPubdate: true,
|
showPubdate: true,
|
||||||
);
|
);
|
||||||
}
|
}, childCount: loadingState.response!.length),
|
||||||
}, childCount: loadingState.response!.length + 1),
|
),
|
||||||
)
|
)
|
||||||
: SliverToBoxAdapter(),
|
: const SliverToBoxAdapter(),
|
||||||
Error() => HttpError(
|
Error() => HttpError(
|
||||||
errMsg: loadingState.errMsg,
|
errMsg: loadingState.errMsg,
|
||||||
callback: _relatedController.onReload,
|
callback: _relatedController.onReload,
|
||||||
|
|||||||
Reference in New Issue
Block a user