fix: footer

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-11 11:06:23 +08:00
parent 01b30d942b
commit ea5c0584cc
5 changed files with 31 additions and 37 deletions

View File

@@ -36,7 +36,7 @@ abstract class CommonController<R, T> extends GetxController
bool isLoading = false;
late bool isEnd = false;
Rx<LoadingState> get loadingState;
bool? isReply;
bool? hasFooter;
Future<LoadingState<R>> customGetData();
@@ -67,7 +67,7 @@ abstract class CommonController<R, T> extends GetxController
isEnd = true;
if (isRefresh) {
loadingState.value = LoadingState<List<T>?>.success(dataList);
} else if (isReply == true) {
} else if (hasFooter == true) {
loadingState.refresh();
}
isLoading = false;

View File

@@ -36,7 +36,7 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
late bool hasUpTop = false;
@override
bool? get isReply => true;
bool? get hasFooter => true;
late final antiGoodsReply = GStorage.antiGoodsReply;

View File

@@ -34,6 +34,9 @@ class FavDetailController
queryData();
}
@override
bool? get hasFooter => true;
@override
List<FavDetailItemData>? getDataList(FavDetailData response) {
return response.list;

View File

@@ -91,27 +91,19 @@ class _OwnerFollowListState extends State<OwnerFollowList>
? ListView.builder(
physics: const AlwaysScrollableScrollPhysics(),
controller: scrollController,
itemCount: followList.length + 1,
itemBuilder: (BuildContext context, int index) {
if (index == followList.length) {
return Container(
height:
MediaQuery.of(context).padding.bottom + 60,
itemCount: followList.length,
padding: EdgeInsets.only(
bottom:
MediaQuery.of(context).padding.bottom),
);
} else {
bottom: MediaQuery.of(context).padding.bottom + 80,
),
itemBuilder: (BuildContext context, int index) {
return FollowItem(
item: followList[index],
ctr: widget.ctr,
callback: (attr) {
followList[index].attribute =
attr == 0 ? -1 : 0;
followList[index].attribute = attr == 0 ? -1 : 0;
followList.refresh();
},
);
}
},
)
: errorWidget(

View File

@@ -49,26 +49,25 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
),
),
Success() => loadingState.response?.isNotEmpty == true
? SliverGrid(
? SliverPadding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom,
),
sliver: SliverGrid(
gridDelegate: SliverGridDelegateWithExtentAndRatio(
mainAxisSpacing: 2,
maxCrossAxisExtent: Grid.mediumCardWidth * 2,
childAspectRatio: StyleString.aspectRatio * 2.2,
),
delegate: SliverChildBuilderDelegate((context, index) {
if (index == loadingState.response!.length) {
return SizedBox(
height: MediaQuery.of(context).padding.bottom,
);
} else {
return VideoCardH(
videoItem: loadingState.response![index],
showPubdate: true,
);
}
}, childCount: loadingState.response!.length + 1),
}, childCount: loadingState.response!.length),
),
)
: SliverToBoxAdapter(),
: const SliverToBoxAdapter(),
Error() => HttpError(
errMsg: loadingState.errMsg,
callback: _relatedController.onReload,