mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 03:31:09 +08:00
member audio
member comic Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
38
lib/pages/member_audio/controller.dart
Normal file
38
lib/pages/member_audio/controller.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/member.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_audio/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_audio/item.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
|
||||
class MemberAudioController
|
||||
extends CommonListController<SpaceAudioData, SpaceAudioItem> {
|
||||
MemberAudioController(this.mid);
|
||||
|
||||
final int mid;
|
||||
int? totalSize;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
queryData();
|
||||
}
|
||||
|
||||
@override
|
||||
void checkIsEnd(int length) {
|
||||
if (totalSize != null && length >= totalSize!) {
|
||||
isEnd = true;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
List<SpaceAudioItem>? getDataList(SpaceAudioData response) {
|
||||
totalSize = response.totalSize;
|
||||
return response.items;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<SpaceAudioData>> customGetData() => MemberHttp.spaceAudio(
|
||||
page: page,
|
||||
mid: mid,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user