Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-18 16:56:43 +08:00
parent f642bfcf48
commit ab80b2a5af
24 changed files with 876 additions and 871 deletions

View File

@@ -61,7 +61,12 @@ class _FansPageState extends State<FansPage> {
physics: const AlwaysScrollableScrollPhysics(),
controller: _fansController.scrollController,
slivers: [
Obx(() => _buildBody(_fansController.loadingState.value)),
SliverPadding(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80),
sliver:
Obx(() => _buildBody(_fansController.loadingState.value)),
),
],
),
),
@@ -84,74 +89,70 @@ class _FansPageState extends State<FansPage> {
),
),
Success(:var response) => response?.isNotEmpty == true
? SliverPadding(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80),
sliver: SliverGrid(
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
mainAxisExtent: 66,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
if (index == response.length - 1) {
_fansController.onLoadMore();
}
final item = response[index];
String heroTag = Utils.makeHeroTag(item.mid);
return ListTile(
onTap: () {
if (widget.onSelect != null) {
widget.onSelect!(UserModel(
mid: item.mid!,
name: item.uname!,
avatar: item.face!,
));
return;
}
Get.toNamed(
'/member?mid=${item.mid}',
arguments: {'face': item.face, 'heroTag': heroTag},
);
},
onLongPress: widget.onSelect != null
? null
: isOwner
? () {
showConfirmDialog(
context: context,
title: '确定移除 ${item.uname} ',
onConfirm: () {
_fansController.onRemoveFan(
index, item.mid!);
},
);
}
: null,
leading: Hero(
tag: heroTag,
child: NetworkImgLayer(
width: 45,
height: 45,
type: ImageType.avatar,
src: item.face,
),
? SliverGrid(
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
mainAxisExtent: 66,
),
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
if (index == response.length - 1) {
_fansController.onLoadMore();
}
final item = response[index];
String heroTag = Utils.makeHeroTag(item.mid);
return ListTile(
onTap: () {
if (widget.onSelect != null) {
widget.onSelect!(UserModel(
mid: item.mid!,
name: item.uname!,
avatar: item.face!,
));
return;
}
Get.toNamed(
'/member?mid=${item.mid}',
arguments: {'face': item.face, 'heroTag': heroTag},
);
},
onLongPress: widget.onSelect != null
? null
: isOwner
? () {
showConfirmDialog(
context: context,
title: '确定移除 ${item.uname} ',
onConfirm: () {
_fansController.onRemoveFan(
index, item.mid!);
},
);
}
: null,
leading: Hero(
tag: heroTag,
child: NetworkImgLayer(
width: 45,
height: 45,
type: ImageType.avatar,
src: item.face,
),
title: Text(
item.uname!,
style: const TextStyle(fontSize: 14),
),
subtitle: Text(
item.sign ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
dense: true,
trailing: const SizedBox(width: 6),
);
},
childCount: response!.length,
),
),
title: Text(
item.uname!,
style: const TextStyle(fontSize: 14),
),
subtitle: Text(
item.sign ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
dense: true,
trailing: const SizedBox(width: 6),
);
},
childCount: response!.length,
),
)
: HttpError(