This commit is contained in:
wyf
2025-08-16 17:45:55 +08:00
parent 7d3e4ad1e8
commit 111bd78a24
15 changed files with 477 additions and 137 deletions

View File

@@ -115,16 +115,42 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
SizedBox(
height: 37.rpx,
),
Text(
"${widget.data['value']}" +
((widget.data['unit'] == null ||
widget.data['unit'].toString().isEmpty)
? ''
: widget.data['unit']),
style: TextStyle(
color: stringToColor("${widget.data['color']}"),
fontSize: 60.rpx,
),
// Text(
// "${widget.data['value']}" +
// ((widget.data['unit'] == null ||
// widget.data['unit'].toString().isEmpty)
// ? ''
// : widget.data['unit']),
// style: TextStyle(
// color: stringToColor("${widget.data['color']}"),
// fontSize: 60.rpx,
// ),
// ),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
"${widget.data['value']}",
style: TextStyle(
color: stringToColor("${widget.data['color']}"),
fontSize: 60.rpx,
),
),
if (widget.data['unit'] != null &&
widget.data['unit'].toString().isNotEmpty)
Padding(
padding: EdgeInsets.only(left: 4.rpx), // 添加适当间距
child: Text(
"${widget.data['unit']}",
style: TextStyle(
color: stringToColor("${widget.data['color']}"),
fontSize: 30.rpx, // 单位使用较小字号
),
),
),
],
),
SizedBox(
height: 81.rpx,
@@ -288,7 +314,6 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text.rich(
TextSpan(
@@ -323,7 +348,6 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
overflow: TextOverflow.ellipsis,
),
),
if (widget.data['level'] != null)
ClickableContainer(
backgroundColor: (widget.data['color'] == null ||