mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-29 14:56:29 +08:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -26,15 +26,15 @@ class FavCheeseController
|
||||
Future<LoadingState<SpaceCheeseData>> customGetData() =>
|
||||
FavHttp.favPugv(mid: mid, page: page);
|
||||
|
||||
Future<void> onRemove(int index, int? sid) async {
|
||||
Future<void> onRemove(int index, int sid) async {
|
||||
var res = await FavHttp.delFavPugv(sid);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
..refresh();
|
||||
SmartDialog.showToast('已取消收藏');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class _FavCheesePageState extends State<FavCheesePage>
|
||||
context: context,
|
||||
title: '确定取消收藏该课堂?',
|
||||
onConfirm: () =>
|
||||
_controller.onRemove(index, item.seasonId),
|
||||
_controller.onRemove(index, item.seasonId!),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user