更新界面布局
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user