mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-27 04:26:58 +08:00
opt msg top
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,8 +5,8 @@ import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
class AtMeController extends CommonListController<MsgFeedAtMe, AtMeItems> {
|
||||
int cursor = -1;
|
||||
int cursorTime = -1;
|
||||
int? cursor;
|
||||
int? cursorTime;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -25,15 +25,15 @@ class AtMeController extends CommonListController<MsgFeedAtMe, AtMeItems> {
|
||||
if (data.cursor?.isEnd == true) {
|
||||
isEnd = true;
|
||||
}
|
||||
cursor = data.cursor?.id ?? -1;
|
||||
cursorTime = data.cursor?.time ?? -1;
|
||||
cursor = data.cursor?.id;
|
||||
cursorTime = data.cursor?.time;
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onRefresh() {
|
||||
cursor = -1;
|
||||
cursorTime = -1;
|
||||
cursor = null;
|
||||
cursorTime = null;
|
||||
return super.onRefresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,9 +83,12 @@ class _AtMePageState extends State<AtMePage> {
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
String? nativeUri = item.item?.nativeUri;
|
||||
if (nativeUri != null) {
|
||||
PiliScheme.routePushFromUrl(nativeUri);
|
||||
if (nativeUri == null ||
|
||||
nativeUri.isEmpty ||
|
||||
nativeUri.startsWith('?')) {
|
||||
return;
|
||||
}
|
||||
PiliScheme.routePushFromUrl(nativeUri);
|
||||
},
|
||||
onLongPress: () => showConfirmDialog(
|
||||
context: context,
|
||||
|
||||
@@ -7,8 +7,8 @@ import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
class LikeMeController extends CommonDataController<MsgFeedLikeMe, dynamic> {
|
||||
int cursor = -1;
|
||||
int cursorTime = -1;
|
||||
int? cursor;
|
||||
int? cursorTime;
|
||||
|
||||
bool isEnd = false;
|
||||
|
||||
@@ -33,8 +33,8 @@ class LikeMeController extends CommonDataController<MsgFeedLikeMe, dynamic> {
|
||||
data.total?.items.isNullOrEmpty == true) {
|
||||
isEnd = true;
|
||||
}
|
||||
cursor = data.total?.cursor?.id ?? -1;
|
||||
cursorTime = data.total?.cursor?.time ?? -1;
|
||||
cursor = data.total?.cursor?.id;
|
||||
cursorTime = data.total?.cursor?.time;
|
||||
List<LikeMeItems> latest = data.latest?.items ?? [];
|
||||
List<LikeMeItems> total = data.total?.items ?? [];
|
||||
if (!isRefresh && loadingState.value.isSuccess) {
|
||||
@@ -48,8 +48,8 @@ class LikeMeController extends CommonDataController<MsgFeedLikeMe, dynamic> {
|
||||
|
||||
@override
|
||||
Future<void> onRefresh() {
|
||||
cursor = -1;
|
||||
cursorTime = -1;
|
||||
cursor = null;
|
||||
cursorTime = null;
|
||||
return super.onRefresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -178,9 +178,12 @@ class _LikeMePageState extends State<LikeMePage> {
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
String? nativeUri = item.item?.nativeUri;
|
||||
if (nativeUri != null) {
|
||||
PiliScheme.routePushFromUrl(nativeUri);
|
||||
if (nativeUri == null ||
|
||||
nativeUri.isEmpty ||
|
||||
nativeUri.startsWith('?')) {
|
||||
return;
|
||||
}
|
||||
PiliScheme.routePushFromUrl(nativeUri);
|
||||
},
|
||||
onLongPress: () => showDialog(
|
||||
context: context,
|
||||
|
||||
@@ -6,8 +6,8 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
class ReplyMeController
|
||||
extends CommonListController<MsgFeedReplyMe, ReplyMeItems> {
|
||||
int cursor = -1;
|
||||
int cursorTime = -1;
|
||||
int? cursor;
|
||||
int? cursorTime;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -26,15 +26,15 @@ class ReplyMeController
|
||||
if (data.cursor?.isEnd == true) {
|
||||
isEnd = true;
|
||||
}
|
||||
cursor = data.cursor?.id ?? -1;
|
||||
cursorTime = data.cursor?.time ?? -1;
|
||||
cursor = data.cursor?.id;
|
||||
cursorTime = data.cursor?.time;
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onRefresh() {
|
||||
cursor = -1;
|
||||
cursorTime = -1;
|
||||
cursor = null;
|
||||
cursorTime = null;
|
||||
return super.onRefresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,13 +84,16 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
String? nativeUri = item.item?.nativeUri;
|
||||
if (nativeUri != null) {
|
||||
PiliScheme.routePushFromUrl(
|
||||
nativeUri,
|
||||
businessId: item.item?.businessId,
|
||||
oid: item.item?.subjectId,
|
||||
);
|
||||
if (nativeUri == null ||
|
||||
nativeUri.isEmpty ||
|
||||
nativeUri.startsWith('?')) {
|
||||
return;
|
||||
}
|
||||
PiliScheme.routePushFromUrl(
|
||||
nativeUri,
|
||||
businessId: item.item?.businessId,
|
||||
oid: item.item?.subjectId,
|
||||
);
|
||||
},
|
||||
onLongPress: () => showConfirmDialog(
|
||||
context: context,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user