更新日历样式

This commit is contained in:
czz
2025-07-11 17:20:22 +08:00
parent ab94817c2c
commit d11943ec6c
2 changed files with 21 additions and 20 deletions

View File

@@ -23,7 +23,7 @@ Widget MonthDataWidget(
), //睡眠评分
SleepChartContainer(
title: "每日得分",
tipText: "每日得分介绍",
tipText: "用户本月睡眠分数的汇总。",
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -94,7 +94,7 @@ Widget MonthDataWidget(
IndicatorCompareCard(
title: "与上月对比",
headers: ["名称", "上月", "本月", "参考范围"],
tooltip: "与上月对比提示",
tooltip: "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。",
rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) {
return [
Text(
@@ -121,7 +121,7 @@ Widget MonthDataWidget(
),
SleepChartContainer(
title: "本月睡眠时长",
tipText: "每日得分介绍",
tipText: "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和。",
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -187,7 +187,7 @@ Widget MonthDataWidget(
TrendDataTablePage(
title: sleepReport['dysp'][0]['name'],
tipText: "入睡时间趋势提示",
tipText: sleepReport['dysp'][0]['tips'],
chartContent: LineView(
xLabels: [
ChartLables(
@@ -253,7 +253,7 @@ Widget MonthDataWidget(
padding: 45.rpx),
TrendDataTablePage(
title: sleepReport['dysp'][1]['name'],
tipText: "起床时间趋势提示",
tipText: sleepReport['dysp'][1]['tips'],
chartContent: LineView(
xLabels: [
ChartLables(
@@ -319,7 +319,7 @@ Widget MonthDataWidget(
padding: 45.rpx),
TrendDataTablePage(
title: sleepReport['dysp'][2]['name'],
tipText: "心率基准趋势提示",
tipText: sleepReport['dysp'][2]['tips'],
chartContent: LineView(
xLabels: [
ChartLables(
@@ -385,7 +385,7 @@ Widget MonthDataWidget(
padding: 45.rpx),
TrendDataTablePage(
title: sleepReport['dysp'][3]['name'],
tipText: "心率变异性趋势提示",
tipText: sleepReport['dysp'][3]['tips'],
chartContent: LineView(
xLabels: [
ChartLables(
@@ -451,7 +451,7 @@ Widget MonthDataWidget(
padding: 45.rpx),
TrendDataTablePage(
title: sleepReport['dysp'][4]['name'],
tipText: "呼吸基准趋势提示",
tipText: sleepReport['dysp'][4]['tips'],
chartContent: LineView(
xLabels: [
ChartLables(
@@ -579,7 +579,8 @@ List<String> buildSleepValueTexts(
String dateStr = '';
if (item['st'] != null) {
final dt = DateTime.fromMillisecondsSinceEpoch(item['st']);
dateStr = "${dt.year}${dt.month.toString().padLeft(2, '0')}${dt.day.toString().padLeft(2, '0')}";
dateStr =
"${dt.year}${dt.month.toString().padLeft(2, '0')}${dt.day.toString().padLeft(2, '0')}";
}
var q = [
@@ -623,9 +624,9 @@ Map<String, dynamic> buildMonthlyChartData(Map<String, dynamic> dyspData) {
// 获取当前月的总天数(以第一条数据为准)
DateTime baseDate = DateTime.fromMillisecondsSinceEpoch(data.first['st']);
double daysInMonth = DateTime(baseDate.year, baseDate.month + 1, 0)
.day
.toDouble()-1; // 👈 改为 double
double daysInMonth =
DateTime(baseDate.year, baseDate.month + 1, 0).day.toDouble() -
1; // 👈 改为 double
List<Offset> points = [];
List<String> colors = [];