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

6666

parent c9959b5c
......@@ -152,7 +152,7 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: Size(1024, 1366),
designSize: Size(1920, 1199),
builder: (context, child) {
return MultiBlocProvider(
providers: [
......
......@@ -125,28 +125,29 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
return Row(
children: [
Expanded(
flex: 20,
flex: 26,
child: MonitoringPetInfoCard(patientInfo: state.patientInfo),
),
// SizedBox(width: gap),
Expanded(
flex: 40,
flex: 74,
child: Column(
children: [
Expanded(
flex: 32,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 4,
child: _buildMetrics(state.metrics, gap),
child: _buildMetrics(state.metrics, gap), // 4个监控
),
// SizedBox(width: gap),
],
),
),
SizedBox(height: gap),
SizedBox(height: 24.h),
Expanded(
flex: 34,
child: Row(
......@@ -183,19 +184,24 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
Widget _buildMetrics(List<MonitoringMetricBO> metrics, double gap) {
final displayMetrics = _environmentMetrics(metrics);
return Row(
children: displayMetrics
.map(
(metric) => Expanded(
child: Container(
decoration: BoxDecoration(
// border: BoxBorder.all(width: 1.w,color: Colors.red)
),
child: MonitoringMetricCard(metric: metric),
),
final children = <Widget>[];
for (int i = 0; i < displayMetrics.length; i++) {
children.add(
Expanded(
child: Container(
decoration: BoxDecoration(
// border: BoxBorder.all(width: 1.w, color: Colors.red),
),
)
.toList(),
child: MonitoringMetricCard(metric: displayMetrics[i]),
),
),
);
if (i < displayMetrics.length - 1) {
children.add(SizedBox(width: 20.w));
}
}
return Row(
children: children,
);
}
......
......@@ -24,22 +24,21 @@ class MonitoringMetricCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
final displayLabel = _displayLabel(metric.label);
return Container(
decoration: const BoxDecoration(
return Container(
decoration: BoxDecoration(
image: DecorationImage(
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 60.h,),
children: [
Row(
children: [
SizedBox(width: 20.w),
SizedBox(width: 32.w),
Expanded(
flex: 3,
child: Text(
......@@ -48,7 +47,7 @@ class MonitoringMetricCard extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
......@@ -58,14 +57,14 @@ class MonitoringMetricCard extends StatelessWidget {
child: Align(
alignment: Alignment.topLeft,
child: FlutterSwitch(
width: 30.w,
width: 60.w,
height: 30.h,
value: switchValue,
onToggle: onSwitchToggle ?? (_) {},
activeColor: const Color(0xFF75C1DD),
inactiveColor: Color(0xFF0A1B34),
toggleSize: 12.w,
padding: 2.w,
toggleSize: 22.w,
padding: 4.w,
),
),
),
......@@ -73,7 +72,7 @@ class MonitoringMetricCard extends StatelessWidget {
),
// const Spacer(),
Container(
padding: EdgeInsets.only(left: 20.w,top: 40.h),
padding: EdgeInsets.only(left: 32.w,top: 24.h),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
......@@ -81,19 +80,19 @@ class MonitoringMetricCard extends StatelessWidget {
metric.value,
style: TextStyle(
color: const Color(0xFF9DF5FF),
fontSize: 36.sp,
fontSize: 90.sp,
height: 1,
fontWeight: FontWeight.bold,
),
),
SizedBox(width: 6.w),
SizedBox(width: 18.w),
Padding(
padding: EdgeInsets.only(bottom: 3.h),
child: Text(
metric.unit,
style: TextStyle(
color: Colors.white70,
fontSize: 18.sp,
color: Colors.white,
fontSize: 30.sp,
fontWeight: FontWeight.w500,
),
),
......@@ -102,10 +101,10 @@ class MonitoringMetricCard extends StatelessWidget {
),
),
SizedBox(height: 12.h),
SizedBox(height: 22.h),
Container(
width: 100.w,
margin: EdgeInsets.only(left: 20.w),
width: 220.w,
margin: EdgeInsets.only(left: 32.w,),
decoration: BoxDecoration(
// border: Border.all(
// color: Colors.red,
......@@ -122,12 +121,12 @@ class MonitoringMetricCard extends StatelessWidget {
"设定24"+metric.unit,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
fontSize: 24.sp,
),
),
Container(
height: 5.h,
margin: EdgeInsets.only(top: 15.h),
margin: EdgeInsets.only(top: 18.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3.r),
gradient: const LinearGradient(
......@@ -138,12 +137,12 @@ class MonitoringMetricCard extends StatelessWidget {
],
),
Positioned(
right: -45.w,
top: -40.h,
right: -65.w,
top: -20.h,
child: Image.asset(
_iconAsset(metric.label),
width: 60.w,
height: 60.w,
width: 102.w,
height: 102.w,
fit: BoxFit.contain,
),
),
......@@ -151,10 +150,10 @@ class MonitoringMetricCard extends StatelessWidget {
),
),
Container(
margin: EdgeInsets.only(left: 14),
margin: EdgeInsets.only(left: 2.w),
child: Image.asset(
'lib/assets/monitoring/box_bottom_char.png',
width: 140.w,
// width: 140.w,
// height: 60.w,
fit: BoxFit.contain,
),
......
......@@ -14,9 +14,12 @@ class MonitoringPetInfoCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MonitoringPanel(
backgroundAsset: 'lib/assets/monitoring/box_bg_460x905.png',
padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 32.h),
return Container(
decoration: BoxDecoration(
image: DecorationImage(image: AssetImage('lib/assets/monitoring/box_bg_460x905.png'),fit: BoxFit.fill),
border: Border.all(color: Colors.red,width: 1.w)
),
padding: EdgeInsets.only(left: 40.w,right: 40.w, top: 32.h),
child: patientInfo == null ? _buildEmpty() : _buildContent(patientInfo!),
);
}
......@@ -37,9 +40,9 @@ class MonitoringPetInfoCard extends StatelessWidget {
_buildHeader(info),
SizedBox(height: 24.h),
_buildDivider(),
SizedBox(height: 10.h),
SizedBox(height: 20.h),
_buildInfoBlock(info),
SizedBox(height: 10.h),
SizedBox(height: 20.h),
_buildDivider(),
SizedBox(height: 20.h),
_buildCareLevelBlock(info),
......@@ -54,22 +57,14 @@ class MonitoringPetInfoCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 120.w,
height: 120.w,
width: 150.w,
height: 160.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
border: Border.all(color: const Color(0xFF5EE6FF), width: 3.w),
boxShadow: const [
BoxShadow(
color: Color(0x6625BFFF),
blurRadius: 20,
spreadRadius: 2,
),
],
color: const Color(0x261DA7FF),
color: const Color(0xFF1F4E79),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(17.r),
borderRadius: BorderRadius.circular(20.r),
child: info.avatarUrl.isNotEmpty
? Image.network(
info.avatarUrl,
......@@ -77,17 +72,17 @@ class MonitoringPetInfoCard extends StatelessWidget {
errorBuilder: (_, __, ___) => Icon(
Icons.pets,
color: const Color(0xFFAAFAFF),
size: 56.w,
size: 60.w,
),
)
: Icon(
Icons.pets,
color: const Color(0xFFAAFAFF),
size: 56.w,
size: 60.w,
),
),
),
SizedBox(width: 20.w),
SizedBox(width: 24.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -96,15 +91,15 @@ class MonitoringPetInfoCard extends StatelessWidget {
info.name,
style: TextStyle(
color: Colors.white,
fontSize: 32.sp,
fontSize: 42.sp,
fontWeight: FontWeight.w700,
height: 1.2,
),
),
SizedBox(height: 16.h),
_buildTypeRow('类型', info.type),
SizedBox(height: 8.h),
_buildTypeRow('品种', info.breed),
SizedBox(height: 20.h),
_buildTypeRow('类型', info.type, true),
SizedBox(height: 12.h),
_buildTypeRow('品种', info.breed, false),
],
),
),
......@@ -112,23 +107,38 @@ class MonitoringPetInfoCard extends StatelessWidget {
);
}
Widget _buildTypeRow(String label, String value) {
Widget _buildTypeRow(String label, String value, bool first) {
return Row(
children: [
Container(
width: 8.w,
height: 8.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF5EE6FF),
SizedBox(
width: 20.w,
child: Column(
children: [
if (first)
Container(
width: 6.w,
height: 6.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFF5EE6FF),
),
)
else
SizedBox(height: 6.w),
Container(
width: 1.w,
height: 18.h,
color: const Color(0xFF5EE6FF),
),
],
),
),
SizedBox(width: 8.w),
SizedBox(width: 10.w),
Text(
'$label$value',
style: TextStyle(
color: const Color(0xFFB8E8FF),
fontSize: 16.sp,
fontSize: 22.sp,
),
),
],
......@@ -155,13 +165,13 @@ class MonitoringPetInfoCard extends StatelessWidget {
Widget _buildInfoBlock(PatientInfoBO info) {
return Column(
children: [
_buildInfoItem(Icons.note_alt_outlined, '宠物病因', info.disease),
SizedBox(height: 14.h),
_buildInfoItem(Icons.calendar_today_outlined, '入住时间', info.checkInDate),
SizedBox(height: 14.h),
_buildInfoItem(Icons.description_outlined, '宠物病因', info.disease),
SizedBox(height: 20.h),
_buildInfoItem(Icons.home_outlined, '入住时间', info.checkInDate),
SizedBox(height: 20.h),
_buildInfoItem(Icons.medical_services_outlined, '责任医生', info.doctor),
SizedBox(height: 14.h),
_buildInfoItem(Icons.phone_android_outlined, '家长电话', info.phone),
SizedBox(height: 20.h),
_buildInfoItem(Icons.phone_iphone_outlined, '家长电话', info.phone),
],
);
}
......@@ -169,20 +179,20 @@ class MonitoringPetInfoCard extends StatelessWidget {
Widget _buildInfoItem(IconData icon, String label, String value) {
return Row(
children: [
Icon(icon, color: const Color(0xFF5EE6FF), size: 22.w),
SizedBox(width: 12.w),
Icon(icon, color: const Color(0xFF5EE6FF), size: 30.w),
SizedBox(width: 18.w),
Text(
'$label:',
style: TextStyle(
color: const Color(0xFFB8E8FF),
fontSize: 16.sp,
fontSize: 22.sp,
),
),
Text(
value,
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontSize: 22.sp,
fontWeight: FontWeight.w500,
),
),
......@@ -198,11 +208,11 @@ class MonitoringPetInfoCard extends StatelessWidget {
'护理等级',
style: TextStyle(
color: Colors.white,
fontSize: 18.sp,
fontSize: 24.sp,
fontWeight: FontWeight.w600,
),
),
// SizedBox(height: 12.h),
SizedBox(height: 20.h),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
......@@ -210,39 +220,26 @@ class MonitoringPetInfoCard extends StatelessWidget {
info.careLevel,
style: TextStyle(
color: Colors.white,
fontSize: 45.sp,
fontWeight: FontWeight.w500,
letterSpacing: 4.w,
fontSize: 80.sp,
fontWeight: FontWeight.w900,
letterSpacing: 6.w,
shadows: const [
Shadow(
color: Color(0x80FF5E5E),
blurRadius: 12,
color: Color(0x99FF5E5E),
blurRadius: 16,
),
],
),
),
const Spacer(),
Container(
padding: EdgeInsets.all(12.w),
decoration: const BoxDecoration(
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Color(0x66FF5E5E),
blurRadius: 18,
spreadRadius: 4,
),
],
),
child: Icon(
Icons.warning_amber_rounded,
color: Color(0xFFFF6B6B),
size: 40.w,
),
Image.asset(
'lib/assets/monitoring/warning.png',
width: 100.w,
height: 100.w,
),
],
),
// SizedBox(height: 16.h),
SizedBox(height: 20.h),
_buildLevelBar(),
],
);
......@@ -251,46 +248,53 @@ class MonitoringPetInfoCard extends StatelessWidget {
Widget _buildLevelBar() {
const segments = [
Color(0xFFFFFFFF),
Color(0xFF00FF9D),
Color(0xFFFFD66B),
Color(0xFFFF9355),
Color(0xFFFF5E5E),
Color(0xFF25E5B0),
Color(0xFFFFB347),
Color(0xFFFF7A4D),
Color(0xFFFF4E4E),
];
const shadowColors = [
Color(0x99FFFFFF),
Color(0x9900FF9D),
Color(0x99FFD66B),
Color(0x99FF9355),
Color(0x99FF5E5E),
Color(0x9925E5B0),
Color(0x99FFB347),
Color(0x99FF7A4D),
Color(0x99FF4E4E),
];
return Row(
children: segments
.asMap()
.entries
.map((entry) => Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2.w),
height: 8.h,
decoration: BoxDecoration(
color: entry.value,
borderRadius: BorderRadius.circular(2.r),
boxShadow: [
BoxShadow(
color: shadowColors[entry.key],
blurRadius: 6,
),
],
return Container(
padding: EdgeInsets.symmetric(horizontal: 4.w),
decoration: BoxDecoration(
color: const Color(0xFF0A1A2E),
borderRadius: BorderRadius.circular(6.r),
),
child: Row(
children: segments
.asMap()
.entries
.map((entry) => Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 2.w),
height: 10.h,
decoration: BoxDecoration(
color: entry.value,
borderRadius: BorderRadius.circular(2.r),
boxShadow: [
BoxShadow(
color: shadowColors[entry.key],
blurRadius: 6,
),
],
),
),
),
))
.toList(),
))
.toList(),
),
);
}
Widget _buildExitButton() {
return Container(
width: double.infinity,
height: 130.h,
height: 140.h,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('lib/assets/monitoring/title_bg_spacewalk.png'),
......@@ -301,21 +305,21 @@ class MonitoringPetInfoCard extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.chevron_left, color: const Color(0xFF77EFFF), size: 28.w),
Icon(Icons.chevron_left, color: const Color(0xFF77EFFF), size: 28.w),
SizedBox(width: 20.w),
Icon(Icons.chevron_left, color: const Color(0xFF77EFFF), size: 30.w),
Icon(Icons.chevron_left, color: const Color(0xFF77EFFF), size: 30.w),
SizedBox(width: 24.w),
Text(
'出舱',
style: TextStyle(
color: Colors.white,
fontSize: 22.sp,
fontSize: 28.sp,
fontWeight: FontWeight.w700,
letterSpacing: 4.w,
),
),
SizedBox(width: 20.w),
Icon(Icons.chevron_right, color: const Color(0xFF77EFFF), size: 28.w),
Icon(Icons.chevron_right, color: const Color(0xFF77EFFF), size: 28.w),
SizedBox(width: 24.w),
Icon(Icons.chevron_right, color: const Color(0xFF77EFFF), size: 30.w),
Icon(Icons.chevron_right, color: const Color(0xFF77EFFF), size: 30.w),
],
),
),
......
......@@ -13,7 +13,7 @@ class MonitoringTopStatusBar extends StatelessWidget {
fit: BoxFit.fill,
),
),
padding: EdgeInsets.only(left: 20.w,bottom: 22.h),
padding: EdgeInsets.only(left: 32.w,bottom: 22.h),
child: Row(
children: [
// SizedBox(width: 18.w),
......@@ -21,23 +21,23 @@ class MonitoringTopStatusBar extends StatelessWidget {
'总运行时长:9999h',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontSize: 25.sp,
),
),
SizedBox(width: 8.w),
SizedBox(width: 32.w),
Text(
'环境温度:30.68',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontSize: 25.sp,
),
),
SizedBox(width: 8.w),
SizedBox(width: 32.w),
Text(
'总制氧时长:500h',
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontSize: 25.sp,
),
),
// 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