更新界面布局

This commit is contained in:
wyf
2025-06-16 21:08:54 +08:00
parent acde8340a8
commit aa51d92d2b
19 changed files with 2595 additions and 1524 deletions

View File

@@ -46,7 +46,7 @@ class _AdviceComponnetWidgetState extends State<AdviceComponnetWidget> {
Container(
width: double.infinity,
decoration: BoxDecoration(
color: stringToColor("#313541"),
color: stringToColor("#313541").withOpacity(0.6),
borderRadius: BorderRadius.circular(20.rpx),
),
child: Padding(

View File

@@ -6,9 +6,9 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
class SleepRadarChart extends StatelessWidget {
final List<Map<String, dynamic>> data;
final List<Map<String, dynamic>> data;
const SleepRadarChart({Key? key, required this.data}) : super(key: key);
const SleepRadarChart({Key? key, required this.data}) : super(key: key);
// const SleepRadarChart({
// Key? key,
@@ -30,48 +30,52 @@ const SleepRadarChart({Key? key, required this.data}) : super(key: key);
}
Widget _buildRadarChart() {
return AspectRatio(
aspectRatio: 1.3,
child: RadarChart(
RadarChartData(
dataSets: [
// 今日数据
RadarDataSet(
dataEntries: data.map((e) => RadarEntry(value: (e['t'] as num).toDouble())).toList(),
borderColor: stringToColor("#00C1AA"),
borderWidth: 2,
fillColor: Colors.transparent,
entryRadius: 0,
),
// 昨日数据
RadarDataSet(
dataEntries: data.map((e) => RadarEntry(value: (e['y'] as num).toDouble())).toList(),
borderColor: stringToColor("#FFD251"),
borderWidth: 2,
fillColor: Colors.transparent,
entryRadius: 0,
),
],
radarBackgroundColor: stringToColor("#343844"),
radarBorderData: BorderSide(
color: themeController.currentColor.sc4, width: 0.5.rpx),
radarShape: RadarShape.polygon,
titlePositionPercentageOffset: 0.2,
titleTextStyle: TextStyle(
fontSize: AppConstants().normal_text_fontSize,
color: themeController.currentColor.sc3),
getTitle: (index, angle) {
return RadarChartTitle(text: data[index]['name'] ?? '未知'.tr);
},
tickCount: 5,
ticksTextStyle: const TextStyle(color: Colors.transparent, fontSize: 10),
gridBorderData: BorderSide(color: Colors.transparent, width: 1),
tickBorderData: BorderSide(
color: themeController.currentColor.sc4, width: 0.5.rpx),
return AspectRatio(
aspectRatio: 1.3,
child: RadarChart(
RadarChartData(
dataSets: [
// 今日数据
RadarDataSet(
dataEntries: data
.map((e) => RadarEntry(value: (e['t'] as num).toDouble()))
.toList(),
borderColor: stringToColor("#00C1AA"),
borderWidth: 2,
fillColor: Colors.transparent,
entryRadius: 0,
),
// 昨日数据
RadarDataSet(
dataEntries: data
.map((e) => RadarEntry(value: (e['y'] as num).toDouble()))
.toList(),
borderColor: stringToColor("#FFD251"),
borderWidth: 2,
fillColor: Colors.transparent,
entryRadius: 0,
),
],
radarBackgroundColor: stringToColor("#343844").withOpacity(0.6),
radarBorderData: BorderSide(
color: themeController.currentColor.sc4, width: 0.5.rpx),
radarShape: RadarShape.polygon,
titlePositionPercentageOffset: 0.2,
titleTextStyle: TextStyle(
fontSize: AppConstants().normal_text_fontSize,
color: themeController.currentColor.sc3),
getTitle: (index, angle) {
return RadarChartTitle(text: data[index]['name'] ?? '未知'.tr);
},
tickCount: 5,
ticksTextStyle:
const TextStyle(color: Colors.transparent, fontSize: 10),
gridBorderData: BorderSide(color: Colors.transparent, width: 1),
tickBorderData: BorderSide(
color: themeController.currentColor.sc4, width: 0.5.rpx),
),
swapAnimationDuration: const Duration(milliseconds: 400),
),
swapAnimationDuration: const Duration(milliseconds: 400),
),
);
}
);
}
}

View File

@@ -383,7 +383,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
CrossAxisAlignment.end,
children: [
Text(
'实时体征.姓名'.tr,
'姓名'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -396,7 +396,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
Text(
'实时体征.年龄'.tr,
'年龄'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -463,7 +463,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
CrossAxisAlignment.end,
children: [
Text(
'实时体征.设备ID'.tr,
'设备ID'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -476,7 +476,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
Text(
'实时体征.体重'.tr,
'体重'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium

View File

@@ -108,14 +108,19 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
fit: BoxFit.fill, // 填满整个 Container
image: (widget.data['backgroundImg'] != null &&
widget.data['backgroundImg'].toString().isNotEmpty)
? AssetImage(widget.data['backgroundImg'])
: AssetImage('assets/img/bgNoImg.png') as ImageProvider,
fit: BoxFit.fill,
),
),
child: Scaffold(
backgroundColor: Colors.transparent, // 背景透明
appBar: AppBar(
backgroundColor: themeController.currentColor.sc17,
backgroundColor: widget.data['backgroundColor'] != null
? widget.data['backgroundColor'].withOpacity(0.8)
: themeController.currentColor.sc5,
automaticallyImplyLeading: false,
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
titleSpacing: 0,
@@ -162,7 +167,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
minHeight: 90.rpx,
),
decoration: BoxDecoration(
color: themeController.currentColor.sc5),
color: widget.data['backgroundColor'] != null
? widget.data['backgroundColor']
: themeController.currentColor.sc5,
),
child: Padding(
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 15.rpx, 30.rpx, 15.rpx),
@@ -377,7 +385,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
padding: EdgeInsetsDirectional.fromSTEB(
30.rpx, 0.rpx, 30.rpx, 58.rpx),
child: ClickableContainer(
backgroundColor: themeController.currentColor.sc5,
backgroundColor:
widget.data['backgroundColor'] != null
? widget.data['backgroundColor']
: themeController.currentColor.sc5,
highlightColor:
themeController.currentColor.sc5, // 或你希望的点击水波纹颜色
borderRadius: AppConstants()
@@ -399,7 +410,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
CrossAxisAlignment.end,
children: [
Text(
'实时体征.姓名'.tr,
'姓名'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -412,7 +423,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
Text(
'实时体征.年龄'.tr,
'年龄'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -487,7 +498,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
CrossAxisAlignment.end,
children: [
Text(
'实时体征.设备ID'.tr,
'设备ID'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
@@ -500,7 +511,7 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
),
),
Text(
'实时体征.体重'.tr,
'体重'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium