Commit 797d12e9 authored by 张宏's avatar 张宏

6666

parent c9959b5c
...@@ -152,7 +152,7 @@ class _MyAppState extends State<MyApp> { ...@@ -152,7 +152,7 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScreenUtilInit( return ScreenUtilInit(
designSize: Size(1024, 1366), designSize: Size(1920, 1199),
builder: (context, child) { builder: (context, child) {
return MultiBlocProvider( return MultiBlocProvider(
providers: [ providers: [
......
...@@ -125,28 +125,29 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -125,28 +125,29 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
return Row( return Row(
children: [ children: [
Expanded( Expanded(
flex: 20, flex: 26,
child: MonitoringPetInfoCard(patientInfo: state.patientInfo), child: MonitoringPetInfoCard(patientInfo: state.patientInfo),
), ),
// SizedBox(width: gap), // SizedBox(width: gap),
Expanded( Expanded(
flex: 40, flex: 74,
child: Column( child: Column(
children: [ children: [
Expanded( Expanded(
flex: 32, flex: 32,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 4, flex: 4,
child: _buildMetrics(state.metrics, gap), child: _buildMetrics(state.metrics, gap), // 4个监控
), ),
// SizedBox(width: gap), // SizedBox(width: gap),
], ],
), ),
), ),
SizedBox(height: gap), SizedBox(height: 24.h),
Expanded( Expanded(
flex: 34, flex: 34,
child: Row( child: Row(
...@@ -183,19 +184,24 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -183,19 +184,24 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Widget _buildMetrics(List<MonitoringMetricBO> metrics, double gap) { Widget _buildMetrics(List<MonitoringMetricBO> metrics, double gap) {
final displayMetrics = _environmentMetrics(metrics); final displayMetrics = _environmentMetrics(metrics);
return Row( final children = <Widget>[];
children: displayMetrics for (int i = 0; i < displayMetrics.length; i++) {
.map( children.add(
(metric) => Expanded( Expanded(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
// border: BoxBorder.all(width: 1.w,color: Colors.red) // border: BoxBorder.all(width: 1.w, color: Colors.red),
),
child: MonitoringMetricCard(metric: metric),
),
), ),
) child: MonitoringMetricCard(metric: displayMetrics[i]),
.toList(), ),
),
);
if (i < displayMetrics.length - 1) {
children.add(SizedBox(width: 20.w));
}
}
return Row(
children: children,
); );
} }
......
...@@ -24,22 +24,21 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -24,22 +24,21 @@ class MonitoringMetricCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final displayLabel = _displayLabel(metric.label); final displayLabel = _displayLabel(metric.label);
return Container( return Container(
decoration: const BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('lib/assets/monitoring/box_bg_325x372.png'), image: AssetImage('lib/assets/monitoring/box_bg_325x372.png'),
fit: BoxFit.cover, fit: BoxFit.fill,
), ),
// border: BoxBorder.all(width: 1.w,color: Colors.red)
), ),
// padding: EdgeInsets.zero, padding: EdgeInsets.only(left: 10.w,right: 10.w, top: 54.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 60.h,),
Row( Row(
children: [ children: [
SizedBox(width: 32.w),
SizedBox(width: 20.w),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
...@@ -48,7 +47,7 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -48,7 +47,7 @@ class MonitoringMetricCard extends StatelessWidget {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 18.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
...@@ -58,14 +57,14 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -58,14 +57,14 @@ class MonitoringMetricCard extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: FlutterSwitch( child: FlutterSwitch(
width: 30.w, width: 60.w,
height: 30.h, height: 30.h,
value: switchValue, value: switchValue,
onToggle: onSwitchToggle ?? (_) {}, onToggle: onSwitchToggle ?? (_) {},
activeColor: const Color(0xFF75C1DD), activeColor: const Color(0xFF75C1DD),
inactiveColor: Color(0xFF0A1B34), inactiveColor: Color(0xFF0A1B34),
toggleSize: 12.w, toggleSize: 22.w,
padding: 2.w, padding: 4.w,
), ),
), ),
), ),
...@@ -73,7 +72,7 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -73,7 +72,7 @@ class MonitoringMetricCard extends StatelessWidget {
), ),
// const Spacer(), // const Spacer(),
Container( Container(
padding: EdgeInsets.only(left: 20.w,top: 40.h), padding: EdgeInsets.only(left: 32.w,top: 24.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
...@@ -81,19 +80,19 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -81,19 +80,19 @@ class MonitoringMetricCard extends StatelessWidget {
metric.value, metric.value,
style: TextStyle( style: TextStyle(
color: const Color(0xFF9DF5FF), color: const Color(0xFF9DF5FF),
fontSize: 36.sp, fontSize: 90.sp,
height: 1, height: 1,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
SizedBox(width: 6.w), SizedBox(width: 18.w),
Padding( Padding(
padding: EdgeInsets.only(bottom: 3.h), padding: EdgeInsets.only(bottom: 3.h),
child: Text( child: Text(
metric.unit, metric.unit,
style: TextStyle( style: TextStyle(
color: Colors.white70, color: Colors.white,
fontSize: 18.sp, fontSize: 30.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
...@@ -102,10 +101,10 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -102,10 +101,10 @@ class MonitoringMetricCard extends StatelessWidget {
), ),
), ),
SizedBox(height: 12.h), SizedBox(height: 22.h),
Container( Container(
width: 100.w, width: 220.w,
margin: EdgeInsets.only(left: 20.w), margin: EdgeInsets.only(left: 32.w,),
decoration: BoxDecoration( decoration: BoxDecoration(
// border: Border.all( // border: Border.all(
// color: Colors.red, // color: Colors.red,
...@@ -122,12 +121,12 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -122,12 +121,12 @@ class MonitoringMetricCard extends StatelessWidget {
"设定24"+metric.unit, "设定24"+metric.unit,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 14.sp, fontSize: 24.sp,
), ),
), ),
Container( Container(
height: 5.h, height: 5.h,
margin: EdgeInsets.only(top: 15.h), margin: EdgeInsets.only(top: 18.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3.r), borderRadius: BorderRadius.circular(3.r),
gradient: const LinearGradient( gradient: const LinearGradient(
...@@ -138,12 +137,12 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -138,12 +137,12 @@ class MonitoringMetricCard extends StatelessWidget {
], ],
), ),
Positioned( Positioned(
right: -45.w, right: -65.w,
top: -40.h, top: -20.h,
child: Image.asset( child: Image.asset(
_iconAsset(metric.label), _iconAsset(metric.label),
width: 60.w, width: 102.w,
height: 60.w, height: 102.w,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
...@@ -151,10 +150,10 @@ class MonitoringMetricCard extends StatelessWidget { ...@@ -151,10 +150,10 @@ class MonitoringMetricCard extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 14), margin: EdgeInsets.only(left: 2.w),
child: Image.asset( child: Image.asset(
'lib/assets/monitoring/box_bottom_char.png', 'lib/assets/monitoring/box_bottom_char.png',
width: 140.w, // width: 140.w,
// height: 60.w, // height: 60.w,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
......
...@@ -13,7 +13,7 @@ class MonitoringTopStatusBar extends StatelessWidget { ...@@ -13,7 +13,7 @@ class MonitoringTopStatusBar extends StatelessWidget {
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
), ),
padding: EdgeInsets.only(left: 20.w,bottom: 22.h), padding: EdgeInsets.only(left: 32.w,bottom: 22.h),
child: Row( child: Row(
children: [ children: [
// SizedBox(width: 18.w), // SizedBox(width: 18.w),
...@@ -21,23 +21,23 @@ class MonitoringTopStatusBar extends StatelessWidget { ...@@ -21,23 +21,23 @@ class MonitoringTopStatusBar extends StatelessWidget {
'总运行时长:9999h', '总运行时长:9999h',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 25.sp,
), ),
), ),
SizedBox(width: 8.w), SizedBox(width: 32.w),
Text( Text(
'环境温度:30.68', '环境温度:30.68',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 25.sp,
), ),
), ),
SizedBox(width: 8.w), SizedBox(width: 32.w),
Text( Text(
'总制氧时长:500h', '总制氧时长:500h',
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 25.sp,
), ),
), ),
// const Spacer(), // const Spacer(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment