feat: fav topic

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-17 21:55:36 +08:00
parent 1d4eabb770
commit d7eb734aaf
55 changed files with 1509 additions and 500 deletions

View File

@@ -29,8 +29,9 @@ class FavArticleController extends CommonListController {
Future<void> onRemove(index, id) async {
final res = await UserHttp.communityAction(opusId: id, action: 4);
if (res['status']) {
loadingState.value.data!.removeAt(index);
loadingState.refresh();
loadingState
..value.data!.removeAt(index)
..refresh();
SmartDialog.showToast('已取消收藏');
} else {
SmartDialog.showToast(res['msg']);

View File

@@ -68,14 +68,15 @@ class _FavArticlePageState extends State<FavArticlePage>
item: response[index],
onDelete: () {
showConfirmDialog(
context: context,
title: '确定取消收藏?',
onConfirm: () {
_favArticleController.onRemove(
index,
response[index]['opus_id'],
);
});
context: context,
title: '确定取消收藏?',
onConfirm: () {
_favArticleController.onRemove(
index,
response[index]['opus_id'],
);
},
);
},
);
},