更新分享
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user