mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
@@ -1,10 +1,11 @@
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
import 'package:PiliPlus/models/msg/msgfeed_at_me.dart';
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/data.dart';
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/item.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
class AtMeController extends CommonListController<MsgFeedAtMe, AtMeItems> {
|
||||
class AtMeController extends CommonListController<MsgAtData, MsgAtItem> {
|
||||
int? cursor;
|
||||
int? cursorTime;
|
||||
|
||||
@@ -15,19 +16,13 @@ class AtMeController extends CommonListController<MsgFeedAtMe, AtMeItems> {
|
||||
}
|
||||
|
||||
@override
|
||||
List<AtMeItems>? getDataList(MsgFeedAtMe response) {
|
||||
return response.items;
|
||||
}
|
||||
|
||||
@override
|
||||
bool customHandleResponse(bool isRefresh, Success<MsgFeedAtMe> response) {
|
||||
MsgFeedAtMe data = response.response;
|
||||
if (data.cursor?.isEnd == true) {
|
||||
List<MsgAtItem>? getDataList(MsgAtData response) {
|
||||
if (response.cursor?.isEnd == true) {
|
||||
isEnd = true;
|
||||
}
|
||||
cursor = data.cursor?.id;
|
||||
cursorTime = data.cursor?.time;
|
||||
return false;
|
||||
cursor = response.cursor?.id;
|
||||
cursorTime = response.cursor?.time;
|
||||
return response.items;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -38,7 +33,7 @@ class AtMeController extends CommonListController<MsgFeedAtMe, AtMeItems> {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<MsgFeedAtMe>> customGetData() =>
|
||||
Future<LoadingState<MsgAtData>> customGetData() =>
|
||||
MsgHttp.msgFeedAtMe(cursor: cursor, cursorTime: cursorTime);
|
||||
|
||||
Future<void> onRemove(dynamic id, int index) async {
|
||||
|
||||
Reference in New Issue
Block a user