更新ui
This commit is contained in:
@@ -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 ||
|
||||
|
||||
Reference in New Issue
Block a user