Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
laki_icu_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
laki_icu_app
Commits
45154e91
Commit
45154e91
authored
Jun 24, 2026
by
akari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复蓝牙操作BUG
parent
2160220c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
7 deletions
+54
-7
frame_card_green_325x372.png
lib/assets/monitoring/frame_card_green_325x372.png
+0
-0
bluetooth_manager.dart
lib/utils/bluetooth/bluetooth_manager.dart
+0
-0
monitoring_bottom_menu.dart
lib/views/layout/widgets/monitoring_bottom_menu.dart
+45
-2
monitoring_index_cubit.dart
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
+9
-5
No files found.
lib/assets/monitoring/frame_card_green_325x372.png
View replaced file @
2160220c
View file @
45154e91
7.31 KB
|
W:
|
H:
110 KB
|
W:
|
H:
2-up
Swipe
Onion skin
lib/utils/bluetooth/bluetooth_manager.dart
View file @
45154e91
This diff is collapsed.
Click to expand it.
lib/views/layout/widgets/monitoring_bottom_menu.dart
View file @
45154e91
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:laki_icu_app/models/bo/monitoring_bo.dart'
;
import
'package:laki_icu_app/utils/bluetooth/index.dart'
;
typedef
OnMenuItemTap
=
Function
(
String
menuId
);
...
...
@@ -77,15 +78,57 @@ class MonitoringBottomMenu extends StatelessWidget {
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
// 图标
Container
(
StreamBuilder
<
BluetoothConnectionStatus
>(
stream:
appBluetoothManager
.
stateStream
,
initialData:
appBluetoothManager
.
status
,
builder:
(
context
,
snapshot
)
{
final
status
=
snapshot
.
data
;
final
isActive
=
status
==
BluetoothConnectionStatus
.
connectedReady
||
status
==
BluetoothConnectionStatus
.
active
;
return
SizedBox
(
width:
167
.
w
,
height:
62
.
h
,
child:
AnimatedContainer
(
duration:
const
Duration
(
milliseconds:
180
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
isActive
?
7
.
w
:
0
,
vertical:
isActive
?
4
.
h
:
0
,
),
decoration:
isActive
?
BoxDecoration
(
color:
const
Color
(
0xFF063D36
)
.
withValues
(
alpha:
0.22
),
borderRadius:
BorderRadius
.
circular
(
32
.
r
),
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFF39FF88
)
.
withValues
(
alpha:
0.18
),
blurRadius:
12
.
w
,
spreadRadius:
1
.
w
,
),
],
)
:
null
,
child:
ColorFiltered
(
colorFilter:
isActive
?
const
ColorFilter
.
mode
(
Color
(
0xFF8DFFCB
),
BlendMode
.
srcATop
,
)
:
const
ColorFilter
.
mode
(
Colors
.
transparent
,
BlendMode
.
dst
,
),
child:
Image
.
asset
(
item
.
iconPath
,
fit:
BoxFit
.
contain
,
),
),
),
);
},
),
],
),
...
...
lib/views/monitoring/index/cubit/monitoring_index_cubit.dart
View file @
45154e91
...
...
@@ -435,6 +435,9 @@ class MonitoringIndexCubit extends Cubit<MonitoringIndexState> {
try
{
await
_bluetoothManager
.
connectToDevice
(
device
);
if
(!
_bluetoothManager
.
isConnected
)
{
throw
StateError
(
'蓝牙连接未就绪'
);
}
await
_storageService
.
saveBoundBluetoothDevice
(
deviceId:
device
.
remoteId
,
deviceName:
device
.
name
,
...
...
@@ -530,7 +533,11 @@ class MonitoringIndexCubit extends Cubit<MonitoringIndexState> {
'deviceId=
$deviceId
isConnected=
${_bluetoothManager.isConnected}
'
,
);
if
(!
isClosed
)
{
emit
(
state
.
copyWith
(
bluetoothMessage:
'蓝牙设备已自动连接'
));
emit
(
state
.
copyWith
(
bluetoothMessage:
_bluetoothManager
.
isConnected
?
'蓝牙设备已自动连接'
:
'蓝牙自动连接未就绪,等待重试'
,
));
}
}
catch
(
e
)
{
debugPrint
(
...
...
@@ -893,9 +900,6 @@ class MonitoringIndexCubit extends Cubit<MonitoringIndexState> {
_mcuReportChangedSub
?.
cancel
();
_webrtcService
.
dispose
();
_p2pVideoService
.
dispose
();
return
Future
.
wait
([
_disposeMqttClient
(),
_bluetoothManager
.
release
(),
]).
then
((
_
)
=>
super
.
close
());
return
_disposeMqttClient
().
then
((
_
)
=>
super
.
close
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment