Commit 72cbd0e5 authored by 张宏's avatar 张宏

Merge branch 'master' of http://git.ruanyiit.com/zhanghong/laki_icu_app

# Conflicts: # lib/utils/event_bus.dart # lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
parents eec1450c 43d33868
This diff is collapsed.
...@@ -122,6 +122,9 @@ class DeviceControlBloc ...@@ -122,6 +122,9 @@ class DeviceControlBloc
final BleBluetoothManager _bluetoothManager; final BleBluetoothManager _bluetoothManager;
final StorageService _storageService; final StorageService _storageService;
final McuReportFrameDecoder _mcuReportDecoder; final McuReportFrameDecoder _mcuReportDecoder;
static const Duration _careLevelPendingTimeout = Duration(seconds: 5);
int? _pendingCareLevelProtocolValue;
DateTime? _pendingCareLevelSince;
late final StreamSubscription<McuReportChangedEvent> _mcuReportSub; late final StreamSubscription<McuReportChangedEvent> _mcuReportSub;
late final StreamSubscription<BluetoothDataPacket> _bluetoothDataSub; late final StreamSubscription<BluetoothDataPacket> _bluetoothDataSub;
...@@ -220,6 +223,7 @@ class DeviceControlBloc ...@@ -220,6 +223,7 @@ class DeviceControlBloc
'co2Set=${report.co2Setting} ' 'co2Set=${report.co2Setting} '
'sn=${report.sn.isEmpty ? '<EMPTY>' : report.sn}', 'sn=${report.sn.isEmpty ? '<EMPTY>' : report.sn}',
); );
final reportCareLevel = _careLevelFromReportValue(report.levelLight);
final newData = state.data.copyWith( final newData = state.data.copyWith(
sn: report.sn.isEmpty ? state.data.sn : report.sn, sn: report.sn.isEmpty ? state.data.sn : report.sn,
cabinTemp: state.data.cabinTemp.copyWith( cabinTemp: state.data.cabinTemp.copyWith(
...@@ -250,6 +254,11 @@ class DeviceControlBloc ...@@ -250,6 +254,11 @@ class DeviceControlBloc
state.data.co2Concentration.alarmThreshold, state.data.co2Concentration.alarmThreshold,
), ),
), ),
careLevel: reportCareLevel == null
? state.data.careLevel
: state.data.careLevel.copyWith(
currentLevel: reportCareLevel,
),
); );
emit(state.copyWith(data: newData, clearError: true)); emit(state.copyWith(data: newData, clearError: true));
...@@ -683,6 +692,8 @@ class DeviceControlBloc ...@@ -683,6 +692,8 @@ class DeviceControlBloc
DeviceControlCareLevelChanged event, DeviceControlCareLevelChanged event,
Emitter<DeviceControlState> emit, Emitter<DeviceControlState> emit,
) async { ) async {
final protocolValue = _careLevelProtocolValue(event.level);
_markCareLevelPending(protocolValue);
final newData = state.data.copyWith( final newData = state.data.copyWith(
careLevel: state.data.careLevel.copyWith( careLevel: state.data.careLevel.copyWith(
currentLevel: event.level, currentLevel: event.level,
...@@ -695,10 +706,11 @@ class DeviceControlBloc ...@@ -695,10 +706,11 @@ class DeviceControlBloc
)); ));
await _writeControlValueToBluetooth( await _writeControlValueToBluetooth(
identifier: 0xA8, identifier: 0xA8,
setValue: '${_careLevelProtocolValue(event.level)}', setValue: '$protocolValue',
errorPrefix: '护理等级', errorPrefix: '护理等级',
emit: emit, emit: emit,
); );
eventBus.emit(CareLevelChangedEvent(protocolValue));
} }
// ==================== 新风进化控制事件处理 ==================== // ==================== 新风进化控制事件处理 ====================
...@@ -1110,6 +1122,52 @@ class DeviceControlBloc ...@@ -1110,6 +1122,52 @@ class DeviceControlBloc
} }
} }
CareLevel? _careLevelFromProtocolValue(int value) {
switch (value) {
case 0:
return CareLevel.off;
case 1:
return CareLevel.level3;
case 2:
return CareLevel.level2;
case 3:
return CareLevel.level1;
case 4:
return CareLevel.special;
}
return null;
}
CareLevel? _careLevelFromReportValue(int value) {
final pendingValue = _pendingCareLevelProtocolValue;
final pendingSince = _pendingCareLevelSince;
if (pendingValue != null && pendingSince != null) {
final isPendingFresh =
DateTime.now().difference(pendingSince) < _careLevelPendingTimeout;
if (isPendingFresh && value != pendingValue) {
Log.warn(
'🔥🔥🔥 BLE_READ_DEBUG care_level_report_ignored '
'pending=$pendingValue report=$value',
);
return null;
}
if (value == pendingValue || !isPendingFresh) {
_clearPendingCareLevel();
}
}
return _careLevelFromProtocolValue(value);
}
void _markCareLevelPending(int protocolValue) {
_pendingCareLevelProtocolValue = protocolValue;
_pendingCareLevelSince = DateTime.now();
}
void _clearPendingCareLevel() {
_pendingCareLevelProtocolValue = null;
_pendingCareLevelSince = null;
}
List<int>? _buildControlValueCommand({ List<int>? _buildControlValueCommand({
required int identifier, required int identifier,
required String setValue, required String setValue,
......
...@@ -102,9 +102,42 @@ class PatientInfoBO extends Equatable { ...@@ -102,9 +102,42 @@ class PatientInfoBO extends Equatable {
); );
} }
PatientInfoBO copyWith({
String? name,
String? type,
String? phone,
String? breed,
String? doctor,
String? disease,
String? checkInDate,
String? careLevel,
String? avatarUrl,
}) {
return PatientInfoBO(
name: name ?? this.name,
type: type ?? this.type,
phone: phone ?? this.phone,
breed: breed ?? this.breed,
doctor: doctor ?? this.doctor,
disease: disease ?? this.disease,
checkInDate: checkInDate ?? this.checkInDate,
careLevel: careLevel ?? this.careLevel,
avatarUrl: avatarUrl ?? this.avatarUrl,
);
}
@override @override
List<Object?> get props => List<Object?> get props => [
[name, type, phone, breed, doctor, disease, checkInDate, careLevel, avatarUrl]; name,
type,
phone,
breed,
doctor,
disease,
checkInDate,
careLevel,
avatarUrl
];
} }
/// 用途:首页监护舱告警信息展示数据 /// 用途:首页监护舱告警信息展示数据
......
...@@ -58,3 +58,10 @@ class DeviceSensorAlarmEvent { ...@@ -58,3 +58,10 @@ class DeviceSensorAlarmEvent {
const DeviceSensorAlarmEvent({required this.sn, this.alarmInfo}); const DeviceSensorAlarmEvent({required this.sn, this.alarmInfo});
} }
// 护理等级更新事件
class CareLevelChangedEvent {
final int protocolValue;
const CareLevelChangedEvent(this.protocolValue);
}
...@@ -18,6 +18,7 @@ class MonitoringIndexState extends Equatable { ...@@ -18,6 +18,7 @@ class MonitoringIndexState extends Equatable {
final String? error; final String? error;
final List<MonitoringMetricBO> metrics; final List<MonitoringMetricBO> metrics;
final PatientInfoBO? patientInfo; final PatientInfoBO? patientInfo;
final String? currentCareLevel;
final List<AlertInfoBO> alerts; final List<AlertInfoBO> alerts;
/// WebRTC 视频连接状态 /// WebRTC 视频连接状态
...@@ -89,6 +90,7 @@ class MonitoringIndexState extends Equatable { ...@@ -89,6 +90,7 @@ class MonitoringIndexState extends Equatable {
this.error, this.error,
this.metrics = const [], this.metrics = const [],
this.patientInfo, this.patientInfo,
this.currentCareLevel,
this.alerts = const [], this.alerts = const [],
this.cameraAlerts = const [], this.cameraAlerts = const [],
this.videoConnectionState = WebrtcConnectionState.disconnected, this.videoConnectionState = WebrtcConnectionState.disconnected,
...@@ -119,6 +121,7 @@ class MonitoringIndexState extends Equatable { ...@@ -119,6 +121,7 @@ class MonitoringIndexState extends Equatable {
String? error, String? error,
List<MonitoringMetricBO>? metrics, List<MonitoringMetricBO>? metrics,
PatientInfoBO? patientInfo, PatientInfoBO? patientInfo,
String? currentCareLevel,
List<AlertInfoBO>? alerts, List<AlertInfoBO>? alerts,
List<AlertInfoBO>? cameraAlerts, List<AlertInfoBO>? cameraAlerts,
WebrtcConnectionState? videoConnectionState, WebrtcConnectionState? videoConnectionState,
...@@ -144,6 +147,7 @@ class MonitoringIndexState extends Equatable { ...@@ -144,6 +147,7 @@ class MonitoringIndexState extends Equatable {
bool clearBoundBluetoothDevice = false, bool clearBoundBluetoothDevice = false,
bool clearLatestMcuReport = false, bool clearLatestMcuReport = false,
bool clearPatientInfo = false, bool clearPatientInfo = false,
bool clearCurrentCareLevel = false,
bool clearMqttDeviceSn = false, bool clearMqttDeviceSn = false,
bool clearSelectedAlert = false, bool clearSelectedAlert = false,
}) { }) {
...@@ -153,6 +157,9 @@ class MonitoringIndexState extends Equatable { ...@@ -153,6 +157,9 @@ class MonitoringIndexState extends Equatable {
error: error ?? this.error, error: error ?? this.error,
metrics: metrics ?? this.metrics, metrics: metrics ?? this.metrics,
patientInfo: clearPatientInfo ? null : patientInfo ?? this.patientInfo, patientInfo: clearPatientInfo ? null : patientInfo ?? this.patientInfo,
currentCareLevel: clearCurrentCareLevel
? null
: currentCareLevel ?? this.currentCareLevel,
alerts: alerts ?? this.alerts, alerts: alerts ?? this.alerts,
cameraAlerts: cameraAlerts ?? this.cameraAlerts, cameraAlerts: cameraAlerts ?? this.cameraAlerts,
videoConnectionState: videoConnectionState ?? this.videoConnectionState, videoConnectionState: videoConnectionState ?? this.videoConnectionState,
...@@ -183,9 +190,8 @@ class MonitoringIndexState extends Equatable { ...@@ -183,9 +190,8 @@ class MonitoringIndexState extends Equatable {
clearMqttDeviceSn ? null : mqttDeviceSn ?? this.mqttDeviceSn, clearMqttDeviceSn ? null : mqttDeviceSn ?? this.mqttDeviceSn,
cabinCameraSn: cabinCameraSn ?? this.cabinCameraSn, cabinCameraSn: cabinCameraSn ?? this.cabinCameraSn,
cabinWifiPwd: cabinWifiPwd ?? this.cabinWifiPwd, cabinWifiPwd: cabinWifiPwd ?? this.cabinWifiPwd,
selectedAlert: clearSelectedAlert selectedAlert:
? null clearSelectedAlert ? null : selectedAlert ?? this.selectedAlert,
: selectedAlert ?? this.selectedAlert,
); );
} }
...@@ -218,6 +224,7 @@ class MonitoringIndexState extends Equatable { ...@@ -218,6 +224,7 @@ class MonitoringIndexState extends Equatable {
error, error,
metrics, metrics,
patientInfo, patientInfo,
currentCareLevel,
alerts, alerts,
cameraAlerts, cameraAlerts,
videoConnectionState, videoConnectionState,
......
...@@ -8,7 +8,6 @@ import 'package:laki_icu_app/enums/video_stream_mode_enum.dart'; ...@@ -8,7 +8,6 @@ import 'package:laki_icu_app/enums/video_stream_mode_enum.dart';
import 'package:laki_icu_app/models/bo/monitoring_bo.dart'; import 'package:laki_icu_app/models/bo/monitoring_bo.dart';
import 'package:laki_icu_app/utils/event_bus.dart'; import 'package:laki_icu_app/utils/event_bus.dart';
import 'cubit/monitoring_index_cubit.dart'; import 'cubit/monitoring_index_cubit.dart';
import 'cubit/monitoring_index_state.dart'; import 'cubit/monitoring_index_state.dart';
import 'widgets/bluetooth_bind_dialog.dart'; import 'widgets/bluetooth_bind_dialog.dart';
...@@ -41,6 +40,7 @@ class MonitoringIndexContent extends StatefulWidget { ...@@ -41,6 +40,7 @@ class MonitoringIndexContent extends StatefulWidget {
class _MonitoringIndexContentState extends State<MonitoringIndexContent> { class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
late final MonitoringIndexCubit _monitoringIndexCubit; late final MonitoringIndexCubit _monitoringIndexCubit;
StreamSubscription<OpenBluetoothScanEvent>? _bluetoothScanEventSub; StreamSubscription<OpenBluetoothScanEvent>? _bluetoothScanEventSub;
/// 正在弹出框展示的告警,为空表示当前没有弹窗 /// 正在弹出框展示的告警,为空表示当前没有弹窗
AlertInfoBO? _currentDialogAlert; AlertInfoBO? _currentDialogAlert;
...@@ -107,6 +107,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -107,6 +107,7 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
flex: 26, flex: 26,
child: MonitoringPetInfoCard( child: MonitoringPetInfoCard(
patientInfo: state.patientInfo, patientInfo: state.patientInfo,
currentCareLevel: state.currentCareLevel,
onExit: () => _monitoringIndexCubit.clearPatientInfo(), onExit: () => _monitoringIndexCubit.clearPatientInfo(),
onBindPet: () => _monitoringIndexCubit.setTestPatientInfo(), onBindPet: () => _monitoringIndexCubit.setTestPatientInfo(),
), ),
...@@ -187,9 +188,10 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> { ...@@ -187,9 +188,10 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
child: Container( child: Container(
width: 388.w, width: 388.w,
height: 62.h, height: 62.h,
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('lib/assets/monitoring/title_bg_spacewalk.png'), image: AssetImage(
'lib/assets/monitoring/title_bg_spacewalk.png'),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
......
...@@ -15,14 +15,14 @@ class SettingsAboutPanel extends StatelessWidget { ...@@ -15,14 +15,14 @@ class SettingsAboutPanel extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SettingsPanelFrame( return SettingsPanelFrame(
backgroundAsset: settingsAssetPanelMain, backgroundAsset: settingsAssetPanelMain,
padding: EdgeInsets.fromLTRB(42.w, 54.h, 42.w, 48.h), padding: EdgeInsets.fromLTRB(100.w, 80.h, 100.w, 100.h),
child: BlocBuilder<SettingsIndexCubit, SettingsIndexState>( child: BlocBuilder<SettingsIndexCubit, SettingsIndexState>(
builder: (context, state) { builder: (context, state) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
const _LogoPlaceholder(), const _LogoPlaceholder(),
SizedBox(height: 62.h), SizedBox(height: 12.h),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
...@@ -31,9 +31,9 @@ class SettingsAboutPanel extends StatelessWidget { ...@@ -31,9 +31,9 @@ class SettingsAboutPanel extends StatelessWidget {
const _BarcodeCard(), const _BarcodeCard(),
], ],
), ),
SizedBox(height: 36.h), SizedBox(height: 20.h),
Divider(color: const Color(0xFF4CA7D2).withValues(alpha: 0.36)), Divider(color: const Color(0xFF4CA7D2).withValues(alpha: 0.36)),
SizedBox(height: 18.h), SizedBox(height: 4.h),
Expanded( Expanded(
child: Row( child: Row(
children: [ children: [
...@@ -71,8 +71,8 @@ class _LogoPlaceholder extends StatelessWidget { ...@@ -71,8 +71,8 @@ class _LogoPlaceholder extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Center(
child: Container( child: Container(
width: 855.w, width: 863.w,
height: 184.h, height: 150.h,
color: const Color(0xFFD7D7D7), color: const Color(0xFFD7D7D7),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
...@@ -155,8 +155,7 @@ class _DeviceInfoColumn extends StatelessWidget { ...@@ -155,8 +155,7 @@ class _DeviceInfoColumn extends StatelessWidget {
return BlocBuilder<BluetoothReadBloc, BluetoothReadState>( return BlocBuilder<BluetoothReadBloc, BluetoothReadState>(
buildWhen: (previous, current) => previous.info.sn != current.info.sn, buildWhen: (previous, current) => previous.info.sn != current.info.sn,
builder: (context, state) { builder: (context, state) {
final sn = final sn = state.info.sn?.isNotEmpty == true ? state.info.sn! : '--';
state.info.sn?.isNotEmpty == true ? state.info.sn! : 'CNA07212L';
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
...@@ -239,36 +238,42 @@ class _InfoRow extends StatelessWidget { ...@@ -239,36 +238,42 @@ class _InfoRow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return SizedBox(
children: [ height: 96.h,
SizedBox( child: Row(
width: 210.w, children: [
child: Text( SizedBox(
label, width: 210.w,
style: TextStyle( child: Align(
color: Colors.white, alignment: Alignment.centerLeft,
fontSize: 27.sp, child: Text(
fontWeight: FontWeight.w700, label,
style: TextStyle(
color: Colors.white,
fontSize: 27.sp,
fontWeight: FontWeight.w700,
),
),
), ),
), ),
), Expanded(
Expanded( child: Align(
child: Align( alignment: Alignment.centerRight,
alignment: Alignment.centerRight, child: valueWidget ??
child: valueWidget ?? Text(
Text( value ?? '',
value ?? '', maxLines: 1,
maxLines: 1, overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 27.sp,
fontSize: 27.sp, fontWeight: FontWeight.w700,
fontWeight: FontWeight.w700, ),
), ),
), ),
), ),
), ],
], ),
); );
} }
} }
...@@ -282,8 +287,8 @@ class _SelectButton extends StatelessWidget { ...@@ -282,8 +287,8 @@ class _SelectButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: 350.w, width: 350.w,
height: 52.h, height: 96.h,
decoration: settingsButtonDecoration(), decoration: settingsButtonDecoration(asset: settingsAssetDDL),
padding: EdgeInsets.symmetric(horizontal: 28.w), padding: EdgeInsets.symmetric(horizontal: 28.w),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
...@@ -296,12 +301,7 @@ class _SelectButton extends StatelessWidget { ...@@ -296,12 +301,7 @@ class _SelectButton extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
SizedBox(width: 28.w), SizedBox(width: 100.w)
Icon(
Icons.keyboard_arrow_down,
color: const Color(0xFF7CCDF0).withValues(alpha: 0.74),
size: 30.w,
),
], ],
), ),
); );
......
...@@ -4,9 +4,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ...@@ -4,9 +4,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
const String settingsAssetPanelLeft = const String settingsAssetPanelLeft =
'lib/assets/monitoring/box_bg_460x905.png'; 'lib/assets/monitoring/box_bg_460x905.png';
const String settingsAssetPanelMain = const String settingsAssetPanelMain =
'lib/assets/monitoring/box_bg_674x509.png'; 'lib/assets/settings/frame_panel_3900x2000.png';
const String settingsAssetButton =
'lib/assets/monitoring/frame_button_324x164.png'; const String settingsAssetDDL = 'lib/assets/settings/ddl.png';
const String settingsAssetButton = 'lib/assets/settings/frame_333x150.png';
class SettingsPanelFrame extends StatelessWidget { class SettingsPanelFrame extends StatelessWidget {
const SettingsPanelFrame({ const SettingsPanelFrame({
...@@ -37,10 +38,13 @@ class SettingsPanelFrame extends StatelessWidget { ...@@ -37,10 +38,13 @@ class SettingsPanelFrame extends StatelessWidget {
} }
} }
BoxDecoration settingsButtonDecoration({bool active = false}) { BoxDecoration settingsButtonDecoration({
bool active = false,
String asset = settingsAssetButton,
}) {
return BoxDecoration( return BoxDecoration(
image: const DecorationImage( image: DecorationImage(
image: AssetImage(settingsAssetButton), image: AssetImage(asset),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
boxShadow: active boxShadow: active
......
...@@ -3,6 +3,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ...@@ -3,6 +3,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'settings_panel_frame.dart'; import 'settings_panel_frame.dart';
const String _settingsMenuButtonAsset = 'lib/assets/settings/btn_setmenu.png';
const String _settingsMenuButtonActiveAsset =
'lib/assets/settings/btn_setmenu_active.png';
class SettingsSideMenu extends StatelessWidget { class SettingsSideMenu extends StatelessWidget {
const SettingsSideMenu({ const SettingsSideMenu({
super.key, super.key,
...@@ -25,7 +29,7 @@ class SettingsSideMenu extends StatelessWidget { ...@@ -25,7 +29,7 @@ class SettingsSideMenu extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SettingsPanelFrame( return SettingsPanelFrame(
backgroundAsset: settingsAssetPanelLeft, backgroundAsset: settingsAssetPanelLeft,
padding: EdgeInsets.fromLTRB(42.w, 48.h, 42.w, 48.h), padding: EdgeInsets.fromLTRB(36.w, 48.h, 36.w, 48.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
...@@ -37,7 +41,7 @@ class SettingsSideMenu extends StatelessWidget { ...@@ -37,7 +41,7 @@ class SettingsSideMenu extends StatelessWidget {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
SizedBox(height: 34.h), SizedBox(height: 30.h),
Divider(color: const Color(0xFF4CA7D2).withValues(alpha: 0.42)), Divider(color: const Color(0xFF4CA7D2).withValues(alpha: 0.42)),
SizedBox(height: 30.h), SizedBox(height: 30.h),
for (final menu in menus) ...[ for (final menu in menus) ...[
...@@ -46,7 +50,7 @@ class SettingsSideMenu extends StatelessWidget { ...@@ -46,7 +50,7 @@ class SettingsSideMenu extends StatelessWidget {
active: menu == selectedMenu, active: menu == selectedMenu,
onTap: () => onSelected(menu), onTap: () => onSelected(menu),
), ),
SizedBox(height: 22.h), // SizedBox(height: 6.h),
], ],
], ],
), ),
...@@ -71,9 +75,10 @@ class _SettingsMenuButton extends StatelessWidget { ...@@ -71,9 +75,10 @@ class _SettingsMenuButton extends StatelessWidget {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: onTap, onTap: onTap,
child: Container( child: Container(
height: 64.h, width: 388,
padding: EdgeInsets.symmetric(horizontal: 28.w), height: 62,
decoration: settingsButtonDecoration(active: active), // padding: EdgeInsets.symmetric(horizontal: 10.w),
decoration: _settingsMenuButtonDecoration(active: active),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
...@@ -82,23 +87,35 @@ class _SettingsMenuButton extends StatelessWidget { ...@@ -82,23 +87,35 @@ class _SettingsMenuButton extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: active ? const Color(0xFFC9F8FF) : Colors.white, color: active ? const Color(0xFFC9F8FF) : Colors.white,
fontSize: 30.sp, fontSize: 20,
// height: 0.9,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
), ),
Text(
'》》',
style: TextStyle(
color: const Color(0xFF67C9F5)
.withValues(alpha: active ? 0.72 : 0.36),
fontSize: 28.sp,
fontWeight: FontWeight.w700,
),
),
], ],
), ),
), ),
); );
} }
} }
BoxDecoration _settingsMenuButtonDecoration({required bool active}) {
return BoxDecoration(
image: DecorationImage(
image: AssetImage(
active ? _settingsMenuButtonActiveAsset : _settingsMenuButtonAsset,
),
fit: BoxFit.fill,
),
boxShadow: active
? [
BoxShadow(
color: const Color(0xFF45CFFF).withValues(alpha: 0.10),
blurRadius: 18.r,
spreadRadius: 10.r,
),
]
: null,
);
}
...@@ -102,6 +102,7 @@ flutter: ...@@ -102,6 +102,7 @@ flutter:
- lib/assets/tab/ - lib/assets/tab/
- lib/assets/icon/ - lib/assets/icon/
- lib/assets/monitoring/ - lib/assets/monitoring/
- lib/assets/settings/
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
......
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