更新分享
This commit is contained in:
172
lib/component/home_page/DynamicReportDetailWidget.dart
Normal file
172
lib/component/home_page/DynamicReportDetailWidget.dart
Normal file
@@ -0,0 +1,172 @@
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/ServiceConstant.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/home_page/SleepDataModuleWidget.dart';
|
||||
import 'package:vbvs_app/component/home_page/SleepDateWidget.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
class DynamicReportDetailWidget extends StatelessWidget {
|
||||
final List<SleepDateWidget> sleepDateWidgets;
|
||||
final List<SleepDataModuleWidget> sleepDataModuleWidgets;
|
||||
final ThemeController themeController = Get.find();
|
||||
final Map targetDevice;
|
||||
|
||||
DynamicReportDetailWidget({
|
||||
required this.sleepDateWidgets,
|
||||
required this.sleepDataModuleWidgets,
|
||||
required this.targetDevice,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 25.rpx, 0, 25.rpx),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius:
|
||||
BorderRadius.circular(AppConstants().normal_container_radius),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(30.rpx, 30.rpx, 30.rpx, 30.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
_buildHeader(context),
|
||||
_buildSleepDateWidgets(),
|
||||
SizedBox(height: 20.rpx),
|
||||
_buildSleepDataModuleWidgets(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildHeader(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'${targetDevice['person']?['name'] == null ? '未命名'.tr : targetDevice['person']['name']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: themeController.currentColor.sc3,
|
||||
borderRadius: 0,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {
|
||||
String mac = targetDevice['mac'];
|
||||
List<SleepDateWidget> selectedWidgets = sleepDateWidgets
|
||||
.where(
|
||||
(widget) => widget.isSelected == true,
|
||||
)
|
||||
.toList();
|
||||
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
|
||||
int.parse(selectedWidgets[0].time!));
|
||||
String time = MyUtils.formatBindTime(dateTime);
|
||||
String sleepReportUrl =
|
||||
"${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}&date=${time}";
|
||||
Get.toNamed("/sleepReportPage", arguments: sleepReportUrl);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Text(
|
||||
'首页.报告详情'.tr,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 6.rpx, 0, 0.rpx),
|
||||
child: SvgPicture.asset(
|
||||
'assets/img/icon/arrow_right.svg',
|
||||
width: 14.rpx,
|
||||
height: 14.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
].divide(SizedBox(width: 22.rpx)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSleepDateWidgets() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: sleepDateWidgets
|
||||
.map((widget) => widget)
|
||||
.toList()
|
||||
.divide(SizedBox(width: 20.rpx)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSleepDataModuleWidgets() {
|
||||
// bool hasData = sleepDataModuleWidgets.any((w) {
|
||||
// final data = w.data;
|
||||
// return data['state'] != null &&
|
||||
// data['state'].toString().trim().isNotEmpty;
|
||||
// });
|
||||
bool hasData = sleepDataModuleWidgets.length > 0;
|
||||
|
||||
if (!hasData) {
|
||||
return Container(
|
||||
height: 100.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'暂无数据'.tr,
|
||||
style: FlutterFlowTheme.of(Get.context!).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 28.rpx,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: sleepDataModuleWidgets
|
||||
.map((widget) => widget)
|
||||
.toList()
|
||||
.divide(SizedBox(width: 14.rpx)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
class SleepDataModuleWidget extends StatefulWidget {
|
||||
const SleepDataModuleWidget({super.key});
|
||||
final Map<String, dynamic> data;
|
||||
|
||||
const SleepDataModuleWidget({super.key, required this.data});
|
||||
|
||||
@override
|
||||
State<SleepDataModuleWidget> createState() => _SleepDataModuleWidgetState();
|
||||
@@ -33,111 +35,137 @@ class _SleepDataModuleWidgetState extends State<SleepDataModuleWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ThemeController themeController = Get.find();
|
||||
return Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.27,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc5,
|
||||
borderRadius: BorderRadius.circular(20.rpx),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(18.rpx, 18.rpx, 18.rpx, 22.rpx),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'离床次数',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
return ClickableContainer(
|
||||
backgroundColor: themeController.currentColor.sc5,
|
||||
highlightColor: themeController.currentColor.sc3,
|
||||
borderRadius: 20.rpx,
|
||||
padding: EdgeInsetsDirectional.fromSTEB(18.rpx, 18.rpx, 18.rpx, 22.rpx),
|
||||
onTap: () {
|
||||
print('点击了离床次数卡片');
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.27,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 200.rpx,
|
||||
minHeight: 161.rpx,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
Text(
|
||||
'${widget.data['name']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 26.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'${widget.data['value']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 40.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// height: 21.rpx,
|
||||
// ),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'4',
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 10.rpx),
|
||||
child: Text(
|
||||
'${widget.data['unit'] ?? ''}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 40.rpx,
|
||||
fontSize: AppConstants().small_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0, 0.rpx, 10.rpx),
|
||||
child: Text(
|
||||
'次',
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().small_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// Container(
|
||||
// width: MediaQuery.sizeOf(context).width * 0.07,
|
||||
// height: MediaQuery.sizeOf(context).height * 0.014,
|
||||
// constraints: BoxConstraints(
|
||||
// minWidth: 43.rpx,
|
||||
// minHeight: 36.rpx,
|
||||
// ),
|
||||
// child: FFButtonWidget(
|
||||
// onPressed: () {
|
||||
// print('Button pressed ...');
|
||||
// },
|
||||
// // text: '${widget.data['level']}',
|
||||
// text: '${widget.data['level']}',
|
||||
// options: FFButtonOptions(
|
||||
// height: 40.rpx,
|
||||
// padding: EdgeInsets.zero,
|
||||
// // color: themeController.currentColor.sc14,
|
||||
// color: stringToColor('${widget.data['color']}'),
|
||||
// textStyle:
|
||||
// FlutterFlowTheme.of(context).titleSmall.override(
|
||||
// fontFamily: 'Inter Tight',
|
||||
// color: themeController.currentColor.sc3,
|
||||
// // color: stringToColor('${widget.data['color']}'),
|
||||
// letterSpacing: 0.0,
|
||||
// fontSize: 15.rpx,
|
||||
// ),
|
||||
// elevation: 0,
|
||||
// borderRadius: BorderRadius.circular(8.rpx),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
ClickableContainer(
|
||||
backgroundColor: stringToColor('${widget.data['color']}'),
|
||||
highlightColor: themeController.currentColor.sc3,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 0.rpx,
|
||||
vertical: 0.rpx,
|
||||
),
|
||||
Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.07,
|
||||
height: MediaQuery.sizeOf(context).height * 0.014,
|
||||
borderRadius: 8.rpx,
|
||||
onTap: () {
|
||||
print('Button pressed ...');
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 43.rpx,
|
||||
minHeight: 36.rpx,
|
||||
),
|
||||
decoration: BoxDecoration(),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () {
|
||||
print('Button pressed ...');
|
||||
},
|
||||
text: '异常',
|
||||
options: FFButtonOptions(
|
||||
height: 40.rpx,
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 0, 0.rpx, 0),
|
||||
color: themeController.currentColor.sc14,
|
||||
textStyle:
|
||||
FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 15.rpx,
|
||||
),
|
||||
elevation: 0,
|
||||
borderRadius: BorderRadius.circular(8.rpx),
|
||||
),
|
||||
child: Text(
|
||||
'${widget.data['level']}',
|
||||
style: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
fontSize: 15.rpx,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'正常值:0~2',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
),
|
||||
].divide(SizedBox(width: 0.rpx)),
|
||||
),
|
||||
Text(
|
||||
'${widget.data['range']}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().small_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc4),
|
||||
),
|
||||
],
|
||||
),
|
||||
color: themeController.currentColor.sc4,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -6,10 +6,28 @@ import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/device/body_device_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
|
||||
class SleepDateWidget extends StatefulWidget {
|
||||
const SleepDateWidget({super.key});
|
||||
final String? mac;
|
||||
final String? time; // 必传:日期,例如 "07/15"
|
||||
final DateTime date; // 必传:日期,例如 "07/15"
|
||||
final String? score; // 可选:分数,默认为 "--"
|
||||
final String? comment; // 可选:评价,默认为 "暂无".tr
|
||||
final Color? textColor; // 可选:文字颜色,默认为灰色
|
||||
final bool? isSelected; // 是否选中
|
||||
|
||||
const SleepDateWidget({
|
||||
super.key,
|
||||
this.mac,
|
||||
this.time,
|
||||
required this.date,
|
||||
this.score = '--',
|
||||
this.comment = '暂无',
|
||||
this.textColor,
|
||||
this.isSelected = false, // 新增参数,默认不选中
|
||||
});
|
||||
|
||||
@override
|
||||
State<SleepDateWidget> createState() => _SleepDateWidgetState();
|
||||
@@ -19,14 +37,35 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ThemeController themeController = Get.find();
|
||||
BodyDeviceController bodyDeviceController = Get.find();
|
||||
String week = MyUtils.formatDateTimeWeek(widget.date);
|
||||
String day = MyUtils.formatDateTimeDay(widget.date);
|
||||
|
||||
// 选中时背景色为黑色,否则为透明
|
||||
Color backgroundColor =
|
||||
widget.isSelected == true ? Colors.black : Colors.transparent;
|
||||
|
||||
return ClickableContainer(
|
||||
backgroundColor: Colors.transparent, // 原 BoxDecoration 为空
|
||||
highlightColor:
|
||||
themeController.currentColor.sc3.withOpacity(0.1), // 自定义点击波纹颜色
|
||||
borderRadius: AppConstants().normal_container_radius, // 原来没设置圆角
|
||||
backgroundColor: backgroundColor,
|
||||
// highlightColor: themeController.currentColor.sc3.withOpacity(0.1),
|
||||
highlightColor: Colors.transparent,
|
||||
borderRadius: AppConstants().normal_container_radius,
|
||||
padding: EdgeInsets.zero,
|
||||
onTap: () {
|
||||
print("今日评分卡片点击");
|
||||
final mac = widget.mac;
|
||||
final time = widget.time;
|
||||
|
||||
if (bodyDeviceController.sleepReportData.value.containsKey(mac)) {
|
||||
final list = bodyDeviceController.sleepReportData.value[mac];
|
||||
|
||||
for (var item in list!) {
|
||||
item['selected'] = (item['time'] == time);
|
||||
}
|
||||
bodyDeviceController.sleepReportData.value = {
|
||||
...bodyDeviceController.sleepReportData.value,
|
||||
};
|
||||
bodyDeviceController.updateAll();
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: MediaQuery.sizeOf(context).width * 0.19,
|
||||
@@ -36,54 +75,55 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(10.rpx, 25.rpx, 10.rpx, 22.rpx),
|
||||
child: Container(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 14.rpx),
|
||||
child: Text(
|
||||
'今日',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 33.rpx),
|
||||
child: Text(
|
||||
'07/15',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 20.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 16.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'70',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: stringToColor("#00C1AA")),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 14.rpx),
|
||||
child: Text(
|
||||
'${week}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: AppConstants().title_text_fontSize,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 33.rpx),
|
||||
child: Text(
|
||||
'${day}',
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 20.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: themeController.currentColor.sc3,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 16.rpx),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
(widget.score?.isEmpty ?? true) ? '--' : widget.score!,
|
||||
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 48.rpx,
|
||||
letterSpacing: 0.0,
|
||||
color: widget.textColor ??
|
||||
themeController.currentColor.sc4),
|
||||
),
|
||||
if ((widget.score?.trim().isNotEmpty ?? false))
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0, 16.rpx, 0, 0.rpx),
|
||||
child: Text(
|
||||
'分',
|
||||
'分'.tr,
|
||||
style: FlutterFlowTheme.of(context)
|
||||
.bodyMedium
|
||||
.override(
|
||||
@@ -94,40 +134,40 @@ class _SleepDateWidgetState extends State<SleepDateWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 0.2.rpx,
|
||||
height: 2.4.rpx,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 123.rpx,
|
||||
minHeight: 47.rpx,
|
||||
),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () {
|
||||
print('合格按钮点击');
|
||||
},
|
||||
text: (widget.comment?.trim().isEmpty ?? true)
|
||||
? '暂无'.tr
|
||||
: widget.comment!,
|
||||
options: FFButtonOptions(
|
||||
height: 40.rpx,
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(16.rpx, 0, 16.rpx, 0),
|
||||
iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
|
||||
color: widget.textColor ?? themeController.currentColor.sc4,
|
||||
textStyle: FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
elevation: 0,
|
||||
borderRadius: BorderRadius.circular(50.rpx),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 0.2.rpx,
|
||||
height: 2.4.rpx,
|
||||
constraints: BoxConstraints(
|
||||
minWidth: 123.rpx,
|
||||
minHeight: 47.rpx,
|
||||
),
|
||||
child: FFButtonWidget(
|
||||
onPressed: () {
|
||||
print('合格按钮点击');
|
||||
},
|
||||
text: '合格',
|
||||
options: FFButtonOptions(
|
||||
height: 40.rpx,
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(16.rpx, 0, 16.rpx, 0),
|
||||
iconPadding: EdgeInsetsDirectional.fromSTEB(0, 0, 0, 0),
|
||||
color: stringToColor("#00C1AA"),
|
||||
textStyle:
|
||||
FlutterFlowTheme.of(context).titleSmall.override(
|
||||
fontFamily: 'Inter Tight',
|
||||
color: themeController.currentColor.sc3,
|
||||
letterSpacing: 0.0,
|
||||
),
|
||||
elevation: 0,
|
||||
borderRadius: BorderRadius.circular(50.rpx),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user