语言样式

This commit is contained in:
czz
2025-08-16 16:32:15 +08:00
parent b507148465
commit 7d3e4ad1e8
6 changed files with 77 additions and 23 deletions

View File

@@ -321,7 +321,7 @@ Future showMonthSelectionDialog(
final currentYear = DateTime.now().year;
final currentMonth = DateTime.now().month;
final colors = _getDialogColors(AppConstants().ent_type); // 获取颜色配置
final List<int> years = List.generate(100, (i) => DateTime.now().year - i)
..sort();
@@ -330,7 +330,6 @@ Future showMonthSelectionDialog(
// 初始化 yearIndex
final int initYearIndex = years.indexOf(checkDate.year);
final RxInt yearIndex = (initYearIndex >= 0 ? initYearIndex : 0).obs;
final RxInt monthIndex = 0.obs;
bool isInit = true;
@@ -369,7 +368,7 @@ Future showMonthSelectionDialog(
child: Material(
color: Colors.transparent,
child: Dialog(
backgroundColor: const Color(0xFF003058),
backgroundColor: colors.primaryColor,
insetPadding: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0),
@@ -430,9 +429,7 @@ Future showMonthSelectionDialog(
child: Text(
"确定".tr,
style: TextStyle(
fontSize: 30.rpx,
color: stringToColor("#84F5FF"),
),
fontSize: 30.rpx, color: colors.textColor),
),
),
),
@@ -450,7 +447,7 @@ Future showMonthSelectionDialog(
margin:
EdgeInsets.symmetric(horizontal: 95.rpx),
decoration: BoxDecoration(
color: const Color(0xFF84F5FF),
color: colors.highlightColor,
borderRadius: BorderRadius.circular(16.rpx),
),
),
@@ -753,7 +750,6 @@ Future<void> showHeightPickerDialog(
);
}
Future showDayTimeSelectionDialog(
BuildContext context, {
required List<int> dayTimeArr,
@@ -1590,3 +1586,40 @@ Future showCustomConfirmOfWebViewDialog(
},
);
}
class DialogColorScheme {
final Color primaryColor; // 背景色
final Color highlightColor; // 高亮色(选择框背景)
final Color textColor; // 文本色(如"确定"按钮)
DialogColorScheme({
required this.primaryColor,
required this.highlightColor,
required this.textColor,
});
}
// 根据 ent_type 获取颜色配置
DialogColorScheme _getDialogColors(int entType) {
switch (entType) {
case 1: // 企业类型1
return DialogColorScheme(
primaryColor: themeController.currentColor.sc17, // 深紫背景
highlightColor: themeController.currentColor.sc2, // 浅紫高亮
textColor: themeController.currentColor.sc2, // 浅紫文本
);
case 2: // 企业类型2
return DialogColorScheme(
primaryColor: const Color(0xFF003058), // 深蓝背景
highlightColor: const Color(0xFF84F5FF), // 浅蓝高亮
textColor: const Color(0xFF84F5FF), // 浅蓝文本
);
default: // 默认配置
return DialogColorScheme(
primaryColor: const Color(0xFF003058),
highlightColor: const Color(0xFF84F5FF),
textColor: const Color(0xFF84F5FF),
);
}
}

View File

@@ -25,7 +25,7 @@ Widget MonthDataWidget(
), //睡眠评分
SleepChartContainer(
title: "每日得分".tr,
tipText: "用户本月睡眠分数的汇总".tr,
tipText: "用户本月睡眠分数的汇总".tr,
sleepReport: sleepReport,
chartContent: LineView(
xLabels: [
@@ -565,7 +565,7 @@ List<String> buildValueTexts(
// 中文年月日格式
DateTime date = DateTime.fromMillisecondsSinceEpoch(item['st']);
final dateStr = "${date.year}/ ${date.month}/ ${date.day}";
final dateStr = "${date.year}/${date.month}/${date.day}";
return "$prefix$val$suffix\n$dateStr";
}).toList();