opt msg top

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-03 22:34:27 +08:00
parent 19cf085e3e
commit 84e24b5827
8 changed files with 86 additions and 60 deletions

View File

@@ -7,7 +7,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
class SysMsgController
extends CommonListController<List<SystemNotifyList>?, SystemNotifyList> {
final pageSize = 20;
int cursor = -1;
int? cursor;
@override
void onInit() {
@@ -17,10 +17,10 @@ class SysMsgController
@override
void handleListResponse(List<SystemNotifyList> dataList) {
if (cursor == -1) {
if (cursor == null) {
msgSysUpdateCursor(dataList.first.cursor);
}
cursor = dataList.last.cursor ?? -1;
cursor = dataList.last.cursor;
if (!isEnd && dataList.length + 1 < pageSize) {
isEnd = true;
}
@@ -34,7 +34,7 @@ class SysMsgController
@override
Future<void> onRefresh() {
cursor = -1;
cursor = null;
return super.onRefresh();
}