Commit 5a154d67 authored by huqu's avatar huqu

修改样式 & 告警列表

parent fb8b7110
import java.util.Properties
plugins { plugins {
id "com.android.application" id "com.android.application"
id "kotlin-android" id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin" id "dev.flutter.flutter-gradle-plugin"
} }
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties') def localPropertiesFile = rootProject.file('local.properties')
def localProperties = new Properties()
if (localPropertiesFile.exists()) { if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader -> localPropertiesFile.withInputStream { localProperties.load(it) }
localProperties.load(reader)
}
} }
def mStoreFile = rootProject.file("smart_hotel.jks")
def mStorePassword = localProperties.getProperty("storePassword")
def mKeyAlias = localProperties.getProperty("keyAlias")
def mKeyPassword = localProperties.getProperty("keyPassword")
def isRelease = mStoreFile.exists()
&& mStorePassword != null
&& mKeyAlias != null
&& mKeyPassword != null
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) { if (flutterVersionCode == null) {
flutterVersionCode = '1' flutterVersionCode = '1'
...@@ -40,6 +49,17 @@ android { ...@@ -40,6 +49,17 @@ android {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
} }
signingConfigs {
if (isRelease) {
release {
storePassword = mStorePassword
keyAlias = mKeyAlias
keyPassword = mKeyPassword
storeFile = mStoreFile
}
}
}
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.smart_hotel_app" applicationId "com.example.smart_hotel_app"
...@@ -76,9 +96,20 @@ android { ...@@ -76,9 +96,20 @@ android {
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. minifyEnabled true
// Signing with the debug keys for now, so `flutter run --release` works. debuggable false
signingConfig signingConfigs.debug shrinkResources true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
signingConfig = isRelease
? signingConfigs.getByName("release")
: signingConfigs.getByName("debug")
}
debug {
signingConfig = signingConfigs.getByName("debug")
minifyEnabled false
} }
} }
......
...@@ -83,7 +83,7 @@ class _MyAppState extends State<MyApp> { ...@@ -83,7 +83,7 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScreenUtilInit( return ScreenUtilInit(
designSize: Size(750, 1334), designSize: const Size(750, 1334),//figma ui size: 375 * 812,倍率:2:1.6
builder: (context, child) { builder: (context, child) {
return MultiBlocProvider( return MultiBlocProvider(
providers: [ providers: [
......
...@@ -59,17 +59,19 @@ class AlertListItemBO extends Equatable { ...@@ -59,17 +59,19 @@ class AlertListItemBO extends Equatable {
final int alertId; final int alertId;
final String alertTitle; final String alertTitle;
final String alertIcon; final String alertIcon;
final String deviceLocationText; final String deviceName;
final String deviceLocation;
final String alertTime; final String alertTime;
final String handleTime; final String handleTime;
final String alertLevel; final String alertLevel;//1=中警 3=高警
final String alertStatus; final String alertStatus;//0=待处理 1=处理中 2=已确认 3=已关闭 4=误报关闭
const AlertListItemBO({ const AlertListItemBO({
required this.alertId, required this.alertId,
required this.alertTitle, required this.alertTitle,
required this.alertIcon, required this.alertIcon,
required this.deviceLocationText, required this.deviceName,
required this.deviceLocation,
required this.alertTime, required this.alertTime,
required this.handleTime, required this.handleTime,
required this.alertLevel, required this.alertLevel,
...@@ -81,7 +83,8 @@ class AlertListItemBO extends Equatable { ...@@ -81,7 +83,8 @@ class AlertListItemBO extends Equatable {
alertId: json['alertId'] as int? ?? 0, alertId: json['alertId'] as int? ?? 0,
alertTitle: json['alertTitle'] as String? ?? '', alertTitle: json['alertTitle'] as String? ?? '',
alertIcon: json['alertIcon'] as String? ?? '', alertIcon: json['alertIcon'] as String? ?? '',
deviceLocationText: json['deviceLocationText'] as String? ?? '', deviceName: json['deviceName'] as String? ?? '',
deviceLocation: json['deviceLocation'] as String? ?? '',
alertTime: json['alertTime'] as String? ?? '', alertTime: json['alertTime'] as String? ?? '',
handleTime: json['handleTime'] as String? ?? '', handleTime: json['handleTime'] as String? ?? '',
alertLevel: json['alertLevel'] as String? ?? '', alertLevel: json['alertLevel'] as String? ?? '',
...@@ -94,7 +97,8 @@ class AlertListItemBO extends Equatable { ...@@ -94,7 +97,8 @@ class AlertListItemBO extends Equatable {
alertId, alertId,
alertTitle, alertTitle,
alertIcon, alertIcon,
deviceLocationText, deviceName,
deviceLocation,
alertTime, alertTime,
handleTime, handleTime,
alertLevel, alertLevel,
......
...@@ -12,6 +12,8 @@ import 'package:auto_route/auto_route.dart' as _i21; ...@@ -12,6 +12,8 @@ import 'package:auto_route/auto_route.dart' as _i21;
import 'package:flutter/material.dart' as _i22; import 'package:flutter/material.dart' as _i22;
import 'package:smart_hotel_app/views/home/abnormal/abnormal_detail_view.dart' import 'package:smart_hotel_app/views/home/abnormal/abnormal_detail_view.dart'
as _i1; as _i1;
import 'package:smart_hotel_app/views/home/abnormal_list/cubit/abnormal_list_state.dart'
as _i23;
import 'package:smart_hotel_app/views/home/abnormal_list/index_view.dart' import 'package:smart_hotel_app/views/home/abnormal_list/index_view.dart'
as _i2; as _i2;
import 'package:smart_hotel_app/views/home/device/device_detail_view.dart' import 'package:smart_hotel_app/views/home/device/device_detail_view.dart'
...@@ -56,6 +58,7 @@ abstract class $AppRouter extends _i21.RootStackRouter { ...@@ -56,6 +58,7 @@ abstract class $AppRouter extends _i21.RootStackRouter {
child: _i1.AbnormalDetailView( child: _i1.AbnormalDetailView(
key: args.key, key: args.key,
alertId: args.alertId, alertId: args.alertId,
alarmStatus: args.alarmStatus,
), ),
); );
}, },
...@@ -220,12 +223,14 @@ class AbnormalDetailRoute extends _i21.PageRouteInfo<AbnormalDetailRouteArgs> { ...@@ -220,12 +223,14 @@ class AbnormalDetailRoute extends _i21.PageRouteInfo<AbnormalDetailRouteArgs> {
AbnormalDetailRoute({ AbnormalDetailRoute({
_i22.Key? key, _i22.Key? key,
required int alertId, required int alertId,
required _i23.AlarmStatus alarmStatus,
List<_i21.PageRouteInfo>? children, List<_i21.PageRouteInfo>? children,
}) : super( }) : super(
AbnormalDetailRoute.name, AbnormalDetailRoute.name,
args: AbnormalDetailRouteArgs( args: AbnormalDetailRouteArgs(
key: key, key: key,
alertId: alertId, alertId: alertId,
alarmStatus: alarmStatus,
), ),
initialChildren: children, initialChildren: children,
); );
...@@ -240,15 +245,18 @@ class AbnormalDetailRouteArgs { ...@@ -240,15 +245,18 @@ class AbnormalDetailRouteArgs {
const AbnormalDetailRouteArgs({ const AbnormalDetailRouteArgs({
this.key, this.key,
required this.alertId, required this.alertId,
required this.alarmStatus,
}); });
final _i22.Key? key; final _i22.Key? key;
final int alertId; final int alertId;
final _i23.AlarmStatus alarmStatus;
@override @override
String toString() { String toString() {
return 'AbnormalDetailRouteArgs{key: $key, alertId: $alertId}'; return 'AbnormalDetailRouteArgs{key: $key, alertId: $alertId, alarmStatus: $alarmStatus}';
} }
} }
......
...@@ -10,11 +10,18 @@ import 'package:smart_hotel_app/views/home/abnormal/widget/temperature_block.dar ...@@ -10,11 +10,18 @@ import 'package:smart_hotel_app/views/home/abnormal/widget/temperature_block.dar
import 'package:smart_hotel_app/views/home/abnormal/widget/temperature_char_block.dart'; import 'package:smart_hotel_app/views/home/abnormal/widget/temperature_char_block.dart';
import 'package:smart_hotel_app/utils/toast_utils.dart'; import 'package:smart_hotel_app/utils/toast_utils.dart';
import '../abnormal_list/cubit/abnormal_list_state.dart';
@RoutePage() @RoutePage()
class AbnormalDetailView extends StatelessWidget { class AbnormalDetailView extends StatelessWidget {
final int alertId; final int alertId;
final AlarmStatus alarmStatus;
const AbnormalDetailView({super.key, required this.alertId}); const AbnormalDetailView({
super.key,
required this.alertId,
required this.alarmStatus,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -33,11 +40,11 @@ class AbnormalDetailView extends StatelessWidget { ...@@ -33,11 +40,11 @@ class AbnormalDetailView extends StatelessWidget {
}, },
), ),
title: Text( title: Text(
'告警详情', '查看告警详情',
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
...@@ -91,6 +98,7 @@ class AbnormalDetailView extends StatelessWidget { ...@@ -91,6 +98,7 @@ class AbnormalDetailView extends StatelessWidget {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (alarmStatus != AlarmStatus.processed) ...[
BlocBuilder<AbnormalCubit, AbnormalState>( BlocBuilder<AbnormalCubit, AbnormalState>(
builder: (context, state) { builder: (context, state) {
final isDisabled = state.isHandling || state.isHandled; final isDisabled = state.isHandling || state.isHandled;
...@@ -111,9 +119,9 @@ class AbnormalDetailView extends StatelessWidget { ...@@ -111,9 +119,9 @@ class AbnormalDetailView extends StatelessWidget {
? SizedBox( ? SizedBox(
width: 32.sp, width: 32.sp,
height: 32.sp, height: 32.sp,
child: CircularProgressIndicator( child: const CircularProgressIndicator(
strokeWidth: 3, strokeWidth: 3,
color: const Color.fromRGBO(237, 245, 255, 1), color: Color.fromRGBO(237, 245, 255, 1),
), ),
) )
: Text( : Text(
...@@ -128,6 +136,7 @@ class AbnormalDetailView extends StatelessWidget { ...@@ -128,6 +136,7 @@ class AbnormalDetailView extends StatelessWidget {
}, },
), ),
SizedBox(height: 20.h), SizedBox(height: 20.h),
],
Container( Container(
width: double.infinity, width: double.infinity,
height: 88.h, height: 88.h,
......
...@@ -39,7 +39,7 @@ class AbnormalCubit extends Cubit<AbnormalState> { ...@@ -39,7 +39,7 @@ class AbnormalCubit extends Cubit<AbnormalState> {
return AlarmInfo( return AlarmInfo(
alarmType: basic.alertTitle, alarmType: basic.alertTitle,
deviceInfo: basic.alertDeviceLocation, deviceInfo: basic.alertDeviceLocation,
alarmLevel: basic.alertLevelText, alertLevelText: basic.alertLevelText,
urgency: _mapUrgency(basic.alertLevel), urgency: _mapUrgency(basic.alertLevel),
currentTemp: info.alertValue, currentTemp: info.alertValue,
voltage: '', voltage: '',
...@@ -59,17 +59,18 @@ class AbnormalCubit extends Cubit<AbnormalState> { ...@@ -59,17 +59,18 @@ class AbnormalCubit extends Cubit<AbnormalState> {
return FlSpot(entry.key.toDouble(), entry.value.value); return FlSpot(entry.key.toDouble(), entry.value.value);
}).toList(), }).toList(),
alertDeviceId: basic.alertDeviceId, alertDeviceId: basic.alertDeviceId,
alertCount: basic.alertCount,
); );
} }
String _mapUrgency(String level) { String _mapUrgency(String level) {
switch (level) { switch (level) {
case 'high': case 'danger':
return '紧急'; return '高警';
case 'medium': case 'warning':
return '一般'; return '中警';
default: default:
return '一般'; return '普通';
} }
} }
......
...@@ -3,7 +3,7 @@ import 'package:fl_chart/fl_chart.dart'; ...@@ -3,7 +3,7 @@ import 'package:fl_chart/fl_chart.dart';
class AlarmInfo { class AlarmInfo {
final String alarmType; final String alarmType;
final String deviceInfo; final String deviceInfo;
final String alarmLevel; final String alertLevelText;
final String urgency; final String urgency;
final String currentTemp; final String currentTemp;
final String voltage; final String voltage;
...@@ -21,11 +21,12 @@ class AlarmInfo { ...@@ -21,11 +21,12 @@ class AlarmInfo {
final List<String> temperatureTimes; final List<String> temperatureTimes;
final List<FlSpot> temperatureSpots; final List<FlSpot> temperatureSpots;
final String alertDeviceId; final String alertDeviceId;
final int alertCount;
const AlarmInfo({ const AlarmInfo({
required this.alarmType, required this.alarmType,
required this.deviceInfo, required this.deviceInfo,
required this.alarmLevel, required this.alertLevelText,
required this.urgency, required this.urgency,
required this.currentTemp, required this.currentTemp,
required this.voltage, required this.voltage,
...@@ -43,6 +44,7 @@ class AlarmInfo { ...@@ -43,6 +44,7 @@ class AlarmInfo {
required this.temperatureTimes, required this.temperatureTimes,
required this.temperatureSpots, required this.temperatureSpots,
required this.alertDeviceId, required this.alertDeviceId,
required this.alertCount,
}); });
} }
......
...@@ -33,8 +33,8 @@ class AlarmInfoBlock extends StatelessWidget { ...@@ -33,8 +33,8 @@ class AlarmInfoBlock extends StatelessWidget {
SizedBox(height: 25.h), SizedBox(height: 25.h),
_buildInfoRow( _buildInfoRow(
'告警级别', '告警级别',
'${alarmInfo.alarmLevel}(Level 3)', alarmInfo.alertLevelText,
valueColor: Color.fromRGBO(255, 100, 101, 1), valueColor: const Color.fromRGBO(255, 100, 101, 1),
), ),
SizedBox(height: 25.h), SizedBox(height: 25.h),
_buildInfoRow('闭值设置', alarmInfo.threshold), _buildInfoRow('闭值设置', alarmInfo.threshold),
...@@ -44,13 +44,13 @@ class AlarmInfoBlock extends StatelessWidget { ...@@ -44,13 +44,13 @@ class AlarmInfoBlock extends StatelessWidget {
_buildInfoRow( _buildInfoRow(
'峰值记录', '峰值记录',
alarmInfo.peak, alarmInfo.peak,
valueColor: Color.fromRGBO(250, 204, 21, 1), valueColor: const Color.fromRGBO(250, 204, 21, 1),
), ),
SizedBox(height: 25.h), SizedBox(height: 25.h),
_buildInfoRow( _buildInfoRow(
'关联联动', '关联联动',
alarmInfo.linkAction, alarmInfo.linkAction,
valueColor: Color.fromRGBO(73, 149, 234, 1), valueColor: const Color.fromRGBO(73, 149, 234, 1),
), ),
], ],
), ),
...@@ -71,14 +71,14 @@ class AlarmInfoBlock extends StatelessWidget { ...@@ -71,14 +71,14 @@ class AlarmInfoBlock extends StatelessWidget {
label, label,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color.fromRGBO(100, 116, 139, 1), color: const Color.fromRGBO(100, 116, 139, 1),
), ),
), ),
Text( Text(
displayValue, displayValue,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: valueColor ?? Color.fromRGBO(100, 116, 139, 1), color: valueColor ?? const Color.fromRGBO(100, 116, 139, 1),
), ),
), ),
], ],
......
...@@ -11,26 +11,28 @@ class TemperatureBlock extends StatelessWidget { ...@@ -11,26 +11,28 @@ class TemperatureBlock extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10.h), margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.all(25.w), padding: EdgeInsets.all(25.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.r), borderRadius: BorderRadius.circular(25.r),
color: Colors.white, color: Colors.white,
), ),
child: Row( child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 64.w, width: 70.w,
height: 66.h, height: 66.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromRGBO(219, 234, 254, 1), color: const Color.fromRGBO(219, 234, 254, 1),
borderRadius: BorderRadius.circular(15.r), borderRadius: BorderRadius.circular(8.r),
), ),
child: Icon( child: Icon(
Icons.thermostat_outlined, Icons.thermostat_outlined,
color: Color.fromRGBO(59, 130, 246, 1), color: const Color.fromRGBO(59, 130, 246, 1),
size: 35.sp, size: 40.sp,
), ),
), ),
SizedBox(width: 15.w), SizedBox(width: 15.w),
...@@ -38,6 +40,9 @@ class TemperatureBlock extends StatelessWidget { ...@@ -38,6 +40,9 @@ class TemperatureBlock extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text( Text(
alarmInfo.alarmType, alarmInfo.alarmType,
style: TextStyle( style: TextStyle(
...@@ -46,46 +51,68 @@ class TemperatureBlock extends StatelessWidget { ...@@ -46,46 +51,68 @@ class TemperatureBlock extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
SizedBox(height: 8.h),
Text(
alarmInfo.deviceInfo,
style: TextStyle(
fontSize: 24.sp,
color: Color.fromRGBO(100, 116, 139, 1),
),
),
SizedBox(height: 15.h),
Row( Row(
children: [ children: [
Text( Text(
'${alarmInfo.alarmLevel}·', '${alarmInfo.alertLevelText} · ',
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color.fromRGBO(255, 100, 101, 1), color: const Color.fromRGBO(255, 100, 101, 1),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h), padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color.fromRGBO(255, 158, 159, 0.5), color: const Color.fromRGBO(255, 158, 159, 0.5),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
), ),
child: Text( child: Text(
alarmInfo.urgency, alarmInfo.urgency,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color.fromRGBO(255, 100, 101, 1), color: const Color.fromRGBO(255, 100, 101, 1),
),
),
),
],
),
],
), ),
Text(
alarmInfo.deviceInfo,
style: TextStyle(
fontSize: 24.sp,
color: const Color.fromRGBO(100, 116, 139, 1),
), ),
), ),
], ],
), ),
),
], ],
), ),
SizedBox(height: 5.h),
Row(
children: [
SizedBox(width: 85.w),
Text(
'告警数量:',
style: TextStyle(
fontSize: 28.sp,
color: const Color.fromRGBO(100, 116, 139, 1),
),
),
Text(
alarmInfo.alertCount.toString(),
style: TextStyle(
fontSize: 28.sp,
color: const Color.fromRGBO(255, 100, 101, 1),
),
), ),
], ],
), ),
],
)
); );
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ import 'package:smart_hotel_app/routes/app_router.gr.dart'; ...@@ -7,7 +7,7 @@ import 'package:smart_hotel_app/routes/app_router.gr.dart';
import 'package:smart_hotel_app/services/alert_list_service.dart'; import 'package:smart_hotel_app/services/alert_list_service.dart';
import 'package:smart_hotel_app/views/home/abnormal_list/cubit/abnormal_list_state.dart'; import 'package:smart_hotel_app/views/home/abnormal_list/cubit/abnormal_list_state.dart';
/// AlarmStatus → 告警状态码(API 入参) /// AlarmStatus → 告警状态码: 0=待处理 1=处理中 2=已确认 3=已关闭 4=误报关闭
String? alarmStatusToApi(AlarmStatus filter) { String? alarmStatusToApi(AlarmStatus filter) {
switch (filter) { switch (filter) {
case AlarmStatus.all: case AlarmStatus.all:
...@@ -17,7 +17,7 @@ String? alarmStatusToApi(AlarmStatus filter) { ...@@ -17,7 +17,7 @@ String? alarmStatusToApi(AlarmStatus filter) {
case AlarmStatus.processed: case AlarmStatus.processed:
return '2'; return '2';
case AlarmStatus.falseAlarm: case AlarmStatus.falseAlarm:
return '3'; return '4';
} }
} }
...@@ -77,6 +77,6 @@ class AbnormalListCubit extends Cubit<AbnormalListState> { ...@@ -77,6 +77,6 @@ class AbnormalListCubit extends Cubit<AbnormalListState> {
void onAlarmItemTap(AlarmItem item, BuildContext context) { void onAlarmItemTap(AlarmItem item, BuildContext context) {
final alertId = int.tryParse(item.id) ?? 0; final alertId = int.tryParse(item.id) ?? 0;
context.pushRoute(AbnormalDetailRoute(alertId: alertId)); context.pushRoute(AbnormalDetailRoute(alertId: alertId, alarmStatus: item.status));
} }
} }
...@@ -28,22 +28,21 @@ class AlarmItem extends Equatable { ...@@ -28,22 +28,21 @@ class AlarmItem extends Equatable {
return AlarmItem( return AlarmItem(
id: item.alertId.toString(), id: item.alertId.toString(),
title: item.alertTitle, title: item.alertTitle,
deviceInfo: item.deviceLocationText, deviceInfo: '${item.deviceName}·${item.deviceLocation}',
alarmTime: item.alertTime, alarmTime: item.alertTime.isEmpty ? '--' : item.alertTime,
processTime: item.handleTime.isEmpty ? '--' : item.handleTime, processTime: item.handleTime.isEmpty ? '--' : item.handleTime,
status: _mapAlertStatus(item.alertStatus), status: _mapAlertStatus(item.alertStatus),
level: item.alertLevel, level: _mapAlertLevel(item.alertLevel),
urgency: '', urgency: '',
); );
} }
static AlarmStatus _mapAlertStatus(String status) { // 0=待处理 1=处理中 2=已确认 3=已关闭 4=误报关闭
switch (status) { static AlarmStatus _mapAlertStatus(String alertStatus) {
switch (alertStatus) {
case '0': case '0':
case '1':
return AlarmStatus.pending; return AlarmStatus.pending;
case '2': case '2':
case '3':
return AlarmStatus.processed; return AlarmStatus.processed;
case '4': case '4':
return AlarmStatus.falseAlarm; return AlarmStatus.falseAlarm;
...@@ -52,6 +51,25 @@ class AlarmItem extends Equatable { ...@@ -52,6 +51,25 @@ class AlarmItem extends Equatable {
} }
} }
static String _mapAlertLevel(String alertLevel) {
switch (alertLevel) {
case '3':
case 'danger':
return '高警';
case '2':
case 'warning':
return '中警';
case '1':
case 'info':
return '普通';
default:
return '';
}
}
@override @override
List<Object?> get props => List<Object?> get props =>
[id, title, deviceInfo, alarmTime, processTime, status, level, urgency]; [id, title, deviceInfo, alarmTime, processTime, status, level, urgency];
......
...@@ -82,7 +82,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> { ...@@ -82,7 +82,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
...@@ -95,9 +95,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> { ...@@ -95,9 +95,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> {
SliverToBoxAdapter( SliverToBoxAdapter(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 28.w), padding: EdgeInsets.symmetric(horizontal: 28.w),
child: Column( child: FilterTabBlock(
children: [
FilterTabBlock(
currentFilter: state.currentFilter, currentFilter: state.currentFilter,
onFilterChanged: cubit.setFilter, onFilterChanged: cubit.setFilter,
allCount: state.allCount, allCount: state.allCount,
...@@ -105,9 +103,6 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> { ...@@ -105,9 +103,6 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> {
processedCount: state.processedCount, processedCount: state.processedCount,
falseAlarmCount: state.falseAlarmCount, falseAlarmCount: state.falseAlarmCount,
), ),
SizedBox(height: 10.h),
],
),
), ),
), ),
SliverPadding( SliverPadding(
...@@ -115,8 +110,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> { ...@@ -115,8 +110,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> {
sliver: PagedSliverList<int, AlarmItem>( sliver: PagedSliverList<int, AlarmItem>(
state: pagingState, state: pagingState,
fetchNextPage: fetchNextPage, fetchNextPage: fetchNextPage,
builderDelegate: builderDelegate: PagedChildBuilderDelegate<AlarmItem>(
PagedChildBuilderDelegate<AlarmItem>(
firstPageErrorIndicatorBuilder: (_) => Center( firstPageErrorIndicatorBuilder: (_) => Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
...@@ -179,8 +173,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> { ...@@ -179,8 +173,7 @@ class _AbnormalListBodyState extends State<_AbnormalListBody> {
itemBuilder: (_, item, __) { itemBuilder: (_, item, __) {
return AlarmListItem( return AlarmListItem(
item: item, item: item,
onTap: (i) => onTap: (i) => cubit.onAlarmItemTap(i, context),
cubit.onAlarmItemTap(i, context),
); );
}, },
), ),
......
...@@ -35,6 +35,9 @@ class AlarmListItem extends StatelessWidget { ...@@ -35,6 +35,9 @@ class AlarmListItem extends StatelessWidget {
children: [ children: [
_buildTitleRow(), _buildTitleRow(),
SizedBox(height: 15.h), SizedBox(height: 15.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text( Text(
item.deviceInfo, item.deviceInfo,
style: TextStyle( style: TextStyle(
...@@ -42,6 +45,15 @@ class AlarmListItem extends StatelessWidget { ...@@ -42,6 +45,15 @@ class AlarmListItem extends StatelessWidget {
color: const Color.fromRGBO(100, 116, 139, 1), color: const Color.fromRGBO(100, 116, 139, 1),
), ),
), ),
Text(
item.level,
style: TextStyle(
fontSize: 24.sp,
color: const Color.fromRGBO(255, 100, 101, 1),
),
),
],
),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Text( Text(
'告警时间: ${item.alarmTime}', '告警时间: ${item.alarmTime}',
...@@ -73,7 +85,7 @@ class AlarmListItem extends StatelessWidget { ...@@ -73,7 +85,7 @@ class AlarmListItem extends StatelessWidget {
height: 96.w, height: 96.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color.fromRGBO(237, 245, 255, 1), color: const Color.fromRGBO(237, 245, 255, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(8.r),
), ),
child: Icon( child: Icon(
Icons.thermostat, Icons.thermostat,
...@@ -95,15 +107,16 @@ class AlarmListItem extends StatelessWidget { ...@@ -95,15 +107,16 @@ class AlarmListItem extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
Row(
children: [
_buildStatusBadge(), _buildStatusBadge(),
SizedBox(width: 12.w), // Row(
_buildLevelBadge(), // children: [
SizedBox(width: 8.w), // _buildStatusBadge(),
_buildUrgencyBadge(), // SizedBox(width: 12.w),
], // _buildLevelBadge(),
), // SizedBox(width: 8.w),
// _buildUrgencyBadge(),
// ],
// ),
], ],
); );
} }
...@@ -116,7 +129,7 @@ class AlarmListItem extends StatelessWidget { ...@@ -116,7 +129,7 @@ class AlarmListItem extends StatelessWidget {
switch (item.status) { switch (item.status) {
case AlarmStatus.pending: case AlarmStatus.pending:
bgColor = const Color.fromRGBO(250, 204, 21, 0.15); bgColor = const Color.fromRGBO(254, 247, 217, 1);
textColor = const Color.fromRGBO(250, 204, 21, 1); textColor = const Color.fromRGBO(250, 204, 21, 1);
text = '待处理'; text = '待处理';
icon = Icons.error_outline; icon = Icons.error_outline;
...@@ -134,29 +147,28 @@ class AlarmListItem extends StatelessWidget { ...@@ -134,29 +147,28 @@ class AlarmListItem extends StatelessWidget {
icon = Icons.cancel_outlined; icon = Icons.cancel_outlined;
break; break;
default: default:
bgColor = const Color.fromRGBO(100, 116, 139, 0.15); bgColor = const Color.fromRGBO(100, 116, 139, 0.0);//完全透明
textColor = const Color.fromRGBO(100, 116, 139, 1); textColor = const Color.fromRGBO(100, 116, 139, 1);
text = ''; text = '';
} }
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 8.h), padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 4.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: bgColor, color: bgColor,
borderRadius: BorderRadius.circular(12.r), borderRadius: BorderRadius.circular(40.r),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 6.w,
children: [ children: [
if (icon != null) ...[ Icon(icon, size: 30.w, color: textColor),
Icon(icon, size: 20.w, color: textColor),
SizedBox(width: 6.w),
],
Text( Text(
text, text,
style: TextStyle( style: TextStyle(
fontSize: 22.sp, fontSize: 24.sp,
color: textColor, color: textColor,
fontWeight: FontWeight.w500,
), ),
), ),
], ],
......
...@@ -24,7 +24,7 @@ class FilterTabBlock extends StatelessWidget { ...@@ -24,7 +24,7 @@ class FilterTabBlock extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10.h), margin: EdgeInsets.only(top: 20.h),
child: Row( child: Row(
children: [ children: [
_buildTab('全部', AlarmStatus.all, allCount), _buildTab('全部', AlarmStatus.all, allCount),
...@@ -48,9 +48,14 @@ class FilterTabBlock extends StatelessWidget { ...@@ -48,9 +48,14 @@ class FilterTabBlock extends StatelessWidget {
height: 72.h, height: 72.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: isSelected color: isSelected
? const Color.fromRGBO(73, 149, 234, 1) ? const Color(0x334995EA)
: const Color.fromRGBO(100, 116, 139, 0.1), : const Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
border: isSelected ? Border.all(
color: const Color(0x804995EA),
width: 1.w,
style: BorderStyle.solid,
) : null
), ),
alignment: Alignment.center, alignment: Alignment.center,
child: Row( child: Row(
...@@ -59,24 +64,25 @@ class FilterTabBlock extends StatelessWidget { ...@@ -59,24 +64,25 @@ class FilterTabBlock extends StatelessWidget {
Text( Text(
label, label,
style: TextStyle( style: TextStyle(
fontSize: 26.sp, fontSize: 28.sp,
color: isSelected color: isSelected
? Colors.white ? const Color(0xFF4995EA)
: const Color.fromRGBO(100, 116, 139, 1), : const Color(0xFF64748B),
fontWeight: FontWeight.w500,
), ),
), ),
if (count > 0) ...[ // if (count > 0) ...[
SizedBox(width: 6.w), // SizedBox(width: 6.w),
Text( // Text(
'$count', // '$count',
style: TextStyle( // style: TextStyle(
fontSize: 22.sp, // fontSize: 26.sp,
color: isSelected // color: isSelected
? Colors.white // ? Colors.white
: const Color.fromRGBO(100, 116, 139, 0.8), // : const Color.fromRGBO(100, 116, 139, 0.8),
), // ),
), // ),
], // ],
], ],
), ),
), ),
......
...@@ -44,7 +44,7 @@ class DeviceDetailView extends StatelessWidget { ...@@ -44,7 +44,7 @@ class DeviceDetailView extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
......
...@@ -11,7 +11,7 @@ class StateInfoBlock extends StatelessWidget { ...@@ -11,7 +11,7 @@ class StateInfoBlock extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 10.h), margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.all(25.w), padding: EdgeInsets.all(25.w),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.r), borderRadius: BorderRadius.circular(25.r),
...@@ -20,15 +20,15 @@ class StateInfoBlock extends StatelessWidget { ...@@ -20,15 +20,15 @@ class StateInfoBlock extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 70.w, width: 80.w,
height: 70.h, height: 70.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.r), borderRadius: BorderRadius.circular(15.r),
color: Color.fromRGBO(219, 234, 254, 1), color: const Color.fromRGBO(219, 234, 254, 1),
), ),
child: Icon( child: Icon(
Icons.power, Icons.power,
color: Color.fromRGBO(59, 130, 246, 1), color: const Color.fromRGBO(59, 130, 246, 1),
size: 32.sp, size: 32.sp,
), ),
), ),
...@@ -47,10 +47,10 @@ class StateInfoBlock extends StatelessWidget { ...@@ -47,10 +47,10 @@ class StateInfoBlock extends StatelessWidget {
), ),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Text( Text(
'${deviceInfo.deviceId}·位置: ${deviceInfo.location}', deviceInfo.location,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color.fromRGBO(100, 116, 139, 1), color: const Color.fromRGBO(100, 116, 139, 1),
), ),
), ),
], ],
...@@ -60,7 +60,7 @@ class StateInfoBlock extends StatelessWidget { ...@@ -60,7 +60,7 @@ class StateInfoBlock extends StatelessWidget {
deviceInfo.status, deviceInfo.status,
style: TextStyle( style: TextStyle(
fontSize: 24.sp, fontSize: 24.sp,
color: Color.fromRGBO(20, 184, 166, 1), color: const Color.fromRGBO(20, 184, 166, 1),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
......
...@@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ...@@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/repositories/alert_detail_repository.dart'; import 'package:smart_hotel_app/repositories/alert_detail_repository.dart';
import 'package:smart_hotel_app/routes/app_router.gr.dart'; import 'package:smart_hotel_app/routes/app_router.gr.dart';
import 'package:smart_hotel_app/services/alert_detail_service.dart'; import 'package:smart_hotel_app/services/alert_detail_service.dart';
import 'package:smart_hotel_app/views/home/abnormal_list/cubit/abnormal_list_state.dart';
import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart'; import 'package:smart_hotel_app/views/home/index/cubit/home_index_cubit.dart';
import 'package:smart_hotel_app/utils/toast_utils.dart'; import 'package:smart_hotel_app/utils/toast_utils.dart';
...@@ -140,7 +141,7 @@ class VoltageOperateBlock extends StatelessWidget { ...@@ -140,7 +141,7 @@ class VoltageOperateBlock extends StatelessWidget {
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
context.pushRoute(AbnormalDetailRoute(alertId: alertId)); context.pushRoute(AbnormalDetailRoute(alertId: alertId, alarmStatus: AlarmStatus.pending));
}, },
child: Container( child: Container(
height: 88.h, height: 88.h,
......
...@@ -184,7 +184,7 @@ class _InspectionDetailBodyState extends State<_InspectionDetailBody> { ...@@ -184,7 +184,7 @@ class _InspectionDetailBodyState extends State<_InspectionDetailBody> {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
......
...@@ -51,7 +51,7 @@ class InspectionDeviceView extends StatelessWidget { ...@@ -51,7 +51,7 @@ class InspectionDeviceView extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(100, 116, 139, 1), color: const Color.fromRGBO(100, 116, 139, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
Icon( Icon(
......
...@@ -87,7 +87,7 @@ class _InspectionHistoryBodyState extends State<_InspectionHistoryBody> { ...@@ -87,7 +87,7 @@ class _InspectionHistoryBodyState extends State<_InspectionHistoryBody> {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
......
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_hotel_app/models/bo/user_info_bo.dart';
import 'package:smart_hotel_app/views/profile/index/cubit/profile_state.dart'; import 'package:smart_hotel_app/views/profile/index/cubit/profile_state.dart';
class ProfileCubit extends Cubit<ProfileState> { class ProfileCubit extends Cubit<ProfileState> {
ProfileCubit() : super(const ProfileState()) { final UserInfoBO? _userInfo;
ProfileCubit({UserInfoBO? userInfo})
: _userInfo = userInfo,
super(const ProfileState()) {
initData(); initData();
} }
void initData() { void initData() {
emit(state.copyWith( emit(state.copyWith(
username: '15391514233', username: _userInfo?.phonenumber ?? '',
welcomeText: '欢迎来到智能酒店', welcomeText: '欢迎来到智能酒店',
menuList: [ menuList: [
const MenuItem(icon: Icons.list, title: '设备列表'), // const MenuItem(icon: Icons.list, title: '设备列表'),
const MenuItem(icon: Icons.warning_rounded, title: '告警信息'), // const MenuItem(icon: Icons.warning_rounded, title: '告警信息'),
const MenuItem(icon: Icons.info_outline, title: '帮助'), // const MenuItem(icon: Icons.info_outline, title: '帮助'),
const MenuItem(icon: Icons.person_outline, title: '关于'), // const MenuItem(icon: Icons.person_outline, title: '关于'),
const MenuItem(icon: Icons.logout, title: '退出登录'), // const MenuItem(icon: Icons.logout, title: '退出登录'),
const MenuItem(icon: Icons.logout, title: '注销账号'), // const MenuItem(icon: Icons.logout, title: '注销账号'),
const MenuItem(icon: 'lib/assets/icon/device_list_bg.png', title: '设备列表'),
const MenuItem(icon: 'lib/assets/icon/alarm_info_bg.png', title: '告警信息'),
const MenuItem(icon: 'lib/assets/icon/help_bg.png', title: '帮助'),
const MenuItem(icon: 'lib/assets/icon/about_bg.png', title: '关于'),
const MenuItem(icon: 'lib/assets/icon/exit_login_bg.png', title: '退出登录'),
const MenuItem(icon: 'lib/assets/icon/logout_account_bg.png', title: '注销账号'),
], ],
)); ));
} }
......
...@@ -2,7 +2,7 @@ import 'package:equatable/equatable.dart'; ...@@ -2,7 +2,7 @@ import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MenuItem { class MenuItem {
final IconData icon; final String icon;
final String title; final String title;
final VoidCallback? onTap; final VoidCallback? onTap;
......
...@@ -5,10 +5,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ...@@ -5,10 +5,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smart_hotel_app/blocs/auth/auth_bloc.dart'; import 'package:smart_hotel_app/blocs/auth/auth_bloc.dart';
import 'package:smart_hotel_app/blocs/auth/auth_event.dart'; import 'package:smart_hotel_app/blocs/auth/auth_event.dart';
import 'package:smart_hotel_app/views/profile/index/cubit/profile_cubit.dart'; import 'package:smart_hotel_app/views/profile/index/cubit/profile_cubit.dart';
import 'package:smart_hotel_app/views/profile/index/cubit/profile_state.dart'; import 'package:smart_hotel_app/blocs/auth/auth_state.dart';
import 'package:smart_hotel_app/views/profile/index/widget/profile_header_block.dart'; import 'package:smart_hotel_app/views/profile/index/widget/profile_header_block.dart';
import 'package:smart_hotel_app/views/profile/index/widget/profile_menu_block.dart'; import 'package:smart_hotel_app/views/profile/index/widget/profile_menu_block.dart';
import 'cubit/profile_state.dart';
@RoutePage() @RoutePage()
class ProfileView extends StatelessWidget { class ProfileView extends StatelessWidget {
const ProfileView({super.key}); const ProfileView({super.key});
...@@ -16,7 +18,11 @@ class ProfileView extends StatelessWidget { ...@@ -16,7 +18,11 @@ class ProfileView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocProvider( return BlocProvider(
create: (_) => ProfileCubit(), create: (context) {
final authState = context.read<AuthBloc>().state;
final userInfo = authState is AuthSuccess ? authState.userInfo : null;
return ProfileCubit(userInfo: userInfo);
},
child: _ProfileContent(), child: _ProfileContent(),
); );
} }
...@@ -43,14 +49,13 @@ class _ProfileContent extends StatelessWidget { ...@@ -43,14 +49,13 @@ class _ProfileContent extends StatelessWidget {
username: state.username, username: state.username,
welcomeText: state.welcomeText, welcomeText: state.welcomeText,
), ),
SizedBox(height: 10.h), SizedBox(height: 16.h),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 28.w), padding: EdgeInsets.symmetric(horizontal: 28.w),
child: ProfileMenuBlock( child: ProfileMenuBlock(
menuList: state.menuList, menuList: state.menuList,
onLogout: () { onLogout: () {
context context.read<AuthBloc>()
.read<AuthBloc>()
.add(const AuthLogoutRequestedEvent()); .add(const AuthLogoutRequestedEvent());
}, },
), ),
......
...@@ -31,29 +31,26 @@ class ProfileHeaderBlock extends StatelessWidget { ...@@ -31,29 +31,26 @@ class ProfileHeaderBlock extends StatelessWidget {
SizedBox(height: 40.h), SizedBox(height: 40.h),
Row( Row(
children: [ children: [
Container( ClipOval(
width: 100.w,
height: 100.h,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color.fromRGBO(235, 244, 255, 1.0),
),
child: ClipOval(
child: Image.network( child: Image.network(
'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop&crop=face', 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop&crop=face',
width: 100.w, width: 100.r,
height: 100.h, height: 100.r,
fit: BoxFit.cover, fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) { errorBuilder: (context, error, stackTrace) {
return Icon( return Container(
width: 100.r,
height: 100.r,
color: const Color.fromRGBO(235, 244, 255, 1.0),
child: Icon(
Icons.person, Icons.person,
size: 48.sp, size: 48.sp,
color: const Color.fromRGBO(66, 165, 245, 1.0), color: const Color.fromRGBO(66, 165, 245, 1.0),
),
); );
}, },
), ),
), ),
),
SizedBox(width: 24.w), SizedBox(width: 24.w),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
......
...@@ -21,7 +21,7 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -21,7 +21,7 @@ class ProfileMenuBlock extends StatelessWidget {
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 24.w, vertical: 28.h), padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h),
margin: EdgeInsets.only(bottom: 16.h), margin: EdgeInsets.only(bottom: 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
...@@ -30,16 +30,17 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -30,16 +30,17 @@ class ProfileMenuBlock extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
Container( Container(
width: 68.w, width: 112.w,
height: 68.h, height: 90.h,
alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color.fromRGBO(229, 241, 255, 1), color: const Color.fromRGBO(229, 241, 255, 1),
borderRadius: BorderRadius.circular(28.r), borderRadius: BorderRadius.circular(24.r),
), ),
child: Icon( child: Image.asset(
item.icon, item.icon,
color: const Color.fromRGBO(66, 165, 245, 1.0), width: 48.w,
size: 40.sp, height: 48.h,
), ),
), ),
SizedBox(width: 24.w), SizedBox(width: 24.w),
...@@ -53,12 +54,11 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -53,12 +54,11 @@ class ProfileMenuBlock extends StatelessWidget {
), ),
), ),
), ),
if (item.title == '告警信息' || item.title == '设备列表') // if (item.title == '告警信息' || item.title == '设备列表')
Icon(Icons.chevron_right, Icon(Icons.chevron_right,
color: const Color.fromRGBO(100, 116, 139, 1.0), color: const Color.fromRGBO(100, 116, 139, 1.0),
size: 32.sp, size: 56.sp,
), ),
], ],
), ),
), ),
...@@ -83,13 +83,10 @@ class ProfileMenuBlock extends StatelessWidget { ...@@ -83,13 +83,10 @@ class ProfileMenuBlock extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Column(
width: double.infinity,
child: Column(
children: [ children: [
...menuList.map((item) => _buildMenuItem(context, item)).toList(), ...menuList.map((item) => _buildMenuItem(context, item)).toList(),
], ],
),
); );
} }
} }
\ No newline at end of file
...@@ -35,7 +35,7 @@ class ServiceDeviceDetailView extends StatelessWidget { ...@@ -35,7 +35,7 @@ class ServiceDeviceDetailView extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
......
...@@ -46,7 +46,7 @@ class ServiceRoomDetailView extends StatelessWidget { ...@@ -46,7 +46,7 @@ class ServiceRoomDetailView extends StatelessWidget {
style: TextStyle( style: TextStyle(
color: const Color.fromRGBO(10, 13, 20, 1), color: const Color.fromRGBO(10, 13, 20, 1),
fontSize: 32.sp, fontSize: 32.sp,
fontWeight: FontWeight.w200, fontWeight: FontWeight.w500,
), ),
), ),
centerTitle: true, centerTitle: true,
......
This diff is collapsed.
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