Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-29 13:35:51 +08:00
parent bcbfe5c849
commit 5979ddb60c
46 changed files with 3266 additions and 3293 deletions

View File

@@ -131,110 +131,108 @@ abstract final class RequestUtils {
}
if (context.mounted) {
bool isSpecialFollowed = followStatus!['special'] == 1;
String text = isSpecialFollowed ? '移除特别关注' : '加入特别关注';
showDialog(
context: context,
builder: (context) {
bool isSpecialFollowed = followStatus!['special'] == 1;
String text = isSpecialFollowed ? '移除特别关注' : '加入特别关注';
return AlertDialog(
clipBehavior: Clip.hardEdge,
contentPadding: const EdgeInsets.symmetric(vertical: 12),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
dense: true,
onTap: () async {
Get.back();
final res = await MemberHttp.specialAction(
fid: mid,
isAdd: !isSpecialFollowed,
);
if (res.isSuccess) {
SmartDialog.showToast('$text成功');
afterMod?.call(isSpecialFollowed ? 2 : -10);
} else {
res.toast();
}
},
title: Text(
text,
style: const TextStyle(fontSize: 14),
),
builder: (context) => AlertDialog(
clipBehavior: Clip.hardEdge,
contentPadding: const EdgeInsets.symmetric(vertical: 12),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
dense: true,
onTap: () async {
Get.back();
final res = await MemberHttp.specialAction(
fid: mid,
isAdd: !isSpecialFollowed,
);
if (res.isSuccess) {
SmartDialog.showToast('$text成功');
afterMod?.call(isSpecialFollowed ? 2 : -10);
} else {
res.toast();
}
},
title: Text(
text,
style: const TextStyle(fontSize: 14),
),
ListTile(
dense: true,
onTap: () async {
Get.back();
final result = await showModalBottomSheet<Set<int>>(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, context.mediaQueryShortestSide),
),
builder: (BuildContext context) {
final maxChildSize =
PlatformUtils.isMobile &&
!context.mediaQuerySize.isPortrait
? 1.0
: 0.7;
return DraggableScrollableSheet(
minChildSize: 0,
maxChildSize: 1,
snap: true,
expand: false,
snapSizes: [maxChildSize],
initialChildSize: maxChildSize,
builder:
(
BuildContext context,
ScrollController scrollController,
) {
return GroupPanel(
mid: mid,
tags: followStatus!['tag'],
scrollController: scrollController,
);
},
);
},
);
followStatus!['tag'] = result?.toList();
if (result != null) {
afterMod?.call(result.contains(-10) ? -10 : 2);
}
},
title: const Text(
'设置分组',
style: TextStyle(fontSize: 14),
),
),
ListTile(
dense: true,
onTap: () async {
Get.back();
final result = await showModalBottomSheet<Set<int>>(
context: context,
useSafeArea: true,
isScrollControlled: true,
constraints: BoxConstraints(
maxWidth: min(640, context.mediaQueryShortestSide),
),
builder: (BuildContext context) {
final maxChildSize =
PlatformUtils.isMobile &&
!context.mediaQuerySize.isPortrait
? 1.0
: 0.7;
return DraggableScrollableSheet(
minChildSize: 0,
maxChildSize: 1,
snap: true,
expand: false,
snapSizes: [maxChildSize],
initialChildSize: maxChildSize,
builder:
(
BuildContext context,
ScrollController scrollController,
) {
return GroupPanel(
mid: mid,
tags: followStatus!['tag'],
scrollController: scrollController,
);
},
);
},
);
followStatus!['tag'] = result?.toList();
if (result != null) {
afterMod?.call(result.contains(-10) ? -10 : 2);
}
},
title: const Text(
'设置分组',
style: TextStyle(fontSize: 14),
),
ListTile(
dense: true,
onTap: () async {
Get.back();
final res = await VideoHttp.relationMod(
mid: mid,
act: 2,
reSrc: 11,
);
if (res.isSuccess) {
SmartDialog.showToast('取消关注成功');
afterMod?.call(0);
} else {
res.toast();
}
},
title: const Text(
'取消关注',
style: TextStyle(fontSize: 14),
),
),
ListTile(
dense: true,
onTap: () async {
Get.back();
final res = await VideoHttp.relationMod(
mid: mid,
act: 2,
reSrc: 11,
);
if (res.isSuccess) {
SmartDialog.showToast('取消关注成功');
afterMod?.call(0);
} else {
res.toast();
}
},
title: const Text(
'取消关注',
style: TextStyle(fontSize: 14),
),
],
),
);
},
),
],
),
),
);
}
}