feat: custom grpc reply (#25)

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-29 22:03:02 +08:00
committed by GitHub
parent 9b9e28dcb8
commit be4dfd99c6
28 changed files with 637 additions and 400 deletions

View File

@@ -111,11 +111,16 @@ class BlackListController extends CommonController {
@override
bool customHandleResponse(Success response) {
total.value = response.response.total;
isEnd = response.response.list.isEmpty;
if (response.response.list.isEmpty) {
isEnd = true;
}
if (currentPage != 1 && loadingState.value is Success) {
response.response.list
?.insertAll(0, (loadingState.value as Success).response);
}
if (response.response.list.length >= total.value) {
isEnd = true;
}
loadingState.value = LoadingState.success(response.response.list);
return true;
}