mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: use cascade (#812)
This commit is contained in:
committed by
GitHub
parent
877732e1e7
commit
6f69a45195
@@ -64,8 +64,7 @@ abstract class CommonController<R, T> extends GetxController
|
||||
checkIsEnd(dataList.length);
|
||||
loadingState.value = LoadingState<List<T>?>.success(dataList);
|
||||
} else if (loadingState.value is Success) {
|
||||
List<T> list = (loadingState.value as Success).response;
|
||||
list.addAll(dataList);
|
||||
final list = (loadingState.value.data! as List<T>)..addAll(dataList);
|
||||
checkIsEnd(list.length);
|
||||
loadingState.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user