opt: use cascade (#812)

This commit is contained in:
My-Responsitories
2025-05-04 23:08:06 +08:00
committed by GitHub
parent 877732e1e7
commit 6f69a45195
25 changed files with 52 additions and 88 deletions

View File

@@ -59,7 +59,8 @@ class LiveController
}
late RxBool isLogin = Accounts.main.isLogin.obs;
late Rx<LoadingState> followListState = LoadingState.loading().obs;
late Rx<LoadingState<List<LiveFollowingItemModel>?>> followListState =
Rx(LoadingState.loading());
late int followPage = 1;
late bool followEnd = false;
late RxInt liveCount = 0.obs;
@@ -93,9 +94,8 @@ class LiveController
}
followListState.value = LoadingState.success(dataList);
} else if (followListState.value is Success) {
List<LiveFollowingItemModel> list =
(followListState.value as Success).response;
list.addAll(dataList!);
List<LiveFollowingItemModel> list = followListState.value.data!
..addAll(dataList!);
if (list.length >= liveCount.value) {
followEnd = true;
}