mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
@@ -2,14 +2,15 @@ import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/http/black.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/user/black.dart';
|
||||
import 'package:PiliPlus/models_new/blacklist/data.dart';
|
||||
import 'package:PiliPlus/models_new/blacklist/list.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class BlackListController
|
||||
extends CommonListController<BlackListDataModel, BlackListItem> {
|
||||
extends CommonListController<BlackListData, BlackListItem> {
|
||||
int pageSize = 50;
|
||||
RxInt total = (-1).obs;
|
||||
|
||||
@@ -20,7 +21,7 @@ class BlackListController
|
||||
}
|
||||
|
||||
@override
|
||||
List<BlackListItem>? getDataList(BlackListDataModel response) {
|
||||
List<BlackListItem>? getDataList(BlackListData response) {
|
||||
return response.list;
|
||||
}
|
||||
|
||||
@@ -32,8 +33,7 @@ class BlackListController
|
||||
}
|
||||
|
||||
@override
|
||||
bool customHandleResponse(
|
||||
bool isRefresh, Success<BlackListDataModel> response) {
|
||||
bool customHandleResponse(bool isRefresh, Success<BlackListData> response) {
|
||||
total.value = response.response.total ?? 0;
|
||||
return false;
|
||||
}
|
||||
@@ -56,6 +56,6 @@ class BlackListController
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<BlackListDataModel>> customGetData() =>
|
||||
Future<LoadingState<BlackListData>> customGetData() =>
|
||||
BlackHttp.blackList(pn: page, ps: pageSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user