1.修复睡眠日报中睡眠规律性数据显示错误

2.更新时区设置
This commit is contained in:
wyf
2026-01-07 15:19:16 +08:00
parent 36f19a71eb
commit 575f91e8dd
42 changed files with 4236 additions and 1653 deletions

View File

@@ -58,6 +58,16 @@ class _MessagePageState extends State<MessagePage> {
}
void _onTabChanged(int index) {
int currentIndex = messageController.model.type == 1 ? 0 : 1;
// 只有当切换到不同tab时才重置加载状态
if (currentIndex != index) {
messageController.isLoadingMore = false;
messageController.bodyPage = 1;
messageController.systemPage = 1;
}
messageController.model.type = index == 0 ? 1 : 2;
messageController.updateAll();
_fetchMessageData();
@@ -298,56 +308,47 @@ class _MessagePageState extends State<MessagePage> {
),
backgroundColor: Colors.transparent,
body: SafeArea(
top: true,
child: PageView(
controller: _pageController,
onPageChanged: _onPageChanged,
children: [
Obx(() {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list, "app_vsm");
}),
Obx(() {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list, "app_system");
}),
],
),
),
top: true,
child: Scrollbar(
child: PageView(
controller: _pageController,
onPageChanged: _onPageChanged,
children: [
Obx(() {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list, "app_vsm");
}),
Obx(() {
final list = messageController.messageList.value;
return list.isEmpty
? const NullDataWidget()
: _buildMessageListView(list, "app_system");
}),
],
),
)),
),
),
),
);
}
// Widget _buildMessageListView(List dataList) {
// return Container(
// width: double.infinity,
// padding: EdgeInsets.symmetric(horizontal: 30.rpx),
// child: SingleChildScrollView(
// child: Column(
// children: [
// SizedBox(height: 30.rpx),
// ...dataList
// .map((item) => MessageWidgetWidget(data: item))
// .toList()
// .divide(SizedBox(height: 30.rpx)),
// SizedBox(height: 30.rpx),
// ],
// ),
// ),
// );
// }
Widget _buildMessageListView(List dataList, String type) {
return NotificationListener<ScrollNotification>(
onNotification: (scrollInfo) {
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
// 检查是否滚动到底部,并且没有正在加载
if (scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent &&
!messageController.isLoadingMore) {
messageController.isLoadingMore = true;
// 滑到底部,加载下一页
messageController.loadMore(type);
messageController.loadMore(type).then((_) {
// 加载完成后重置标志位
messageController.isLoadingMore = false;
}).catchError((_) {
messageController.isLoadingMore = false;
});
}
return true;
},