mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: msg btn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import 'package:PiliPlus/grpc/bilibili/app/im/v1.pb.dart'
|
||||
show Offset, Session, SessionId, SessionMainReply, SessionPageType;
|
||||
show
|
||||
Offset,
|
||||
Session,
|
||||
SessionId,
|
||||
SessionMainReply,
|
||||
SessionPageType,
|
||||
ThreeDotItem;
|
||||
import 'package:PiliPlus/grpc/im.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
@@ -18,6 +24,9 @@ class WhisperController
|
||||
|
||||
PbMap<int, Offset>? offset;
|
||||
|
||||
Rx<List<ThreeDotItem>?> threeDotItems = Rx<List<ThreeDotItem>?>(null);
|
||||
Rx<List<ThreeDotItem>?> outsideItem = Rx<List<ThreeDotItem>?>(null);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -72,6 +81,16 @@ class WhisperController
|
||||
return response.sessions;
|
||||
}
|
||||
|
||||
@override
|
||||
bool customHandleResponse(
|
||||
bool isRefresh, Success<SessionMainReply> response) {
|
||||
if (isRefresh) {
|
||||
threeDotItems.value = response.response.threeDotItems;
|
||||
outsideItem.value = response.response.outsideItem;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<SessionMainReply>> customGetData() =>
|
||||
ImGrpc.sessionMain(offset: offset);
|
||||
@@ -140,4 +159,14 @@ class WhisperController
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onDeleteList() async {
|
||||
var res = await ImGrpc.deleteSessionList(
|
||||
pageType: SessionPageType.SESSION_PAGE_TYPE_HOME);
|
||||
if (res['status']) {
|
||||
loadingState.value = LoadingState.success(null);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user