对接路径规划的列表(根据场站的下的)
优化无人机机场的监控视频的显示视频流畅度提升80% 添加首页tcp指示灯的机器状态信息展示功能。(暂不支持在此页面上设备的切换显示)
This commit is contained in:
1347
lib/components/device_status_modal.dart
Normal file
1347
lib/components/device_status_modal.dart
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,13 @@ import 'package:maibu_satabot_v2/core/network/tcp/tcp_status_cubit.dart';
|
||||
class TcpStatusIndicator extends StatefulWidget {
|
||||
final double size;
|
||||
final bool showDisconnected; // 是否显示未连接状态
|
||||
final VoidCallback? onTap; // 点击回调
|
||||
|
||||
const TcpStatusIndicator({
|
||||
super.key,
|
||||
this.size = 12.0,
|
||||
this.showDisconnected = false, // 默认不显示未连接状态
|
||||
this.onTap, // 点击回调
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -27,18 +29,19 @@ class _TcpStatusIndicatorState extends State<TcpStatusIndicator>
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tcpStatusCubit = GetIt.I<TcpStatusCubit>();
|
||||
|
||||
|
||||
_controller = AnimationController(
|
||||
duration: const Duration(milliseconds: 1500),
|
||||
vsync: this,
|
||||
);
|
||||
|
||||
_animation = Tween<double>(begin: 0.6, end: 1.0).animate(
|
||||
CurvedAnimation(parent: _controller!, curve: Curves.easeInOut),
|
||||
);
|
||||
|
||||
|
||||
_animation = Tween<double>(
|
||||
begin: 0.6,
|
||||
end: 1.0,
|
||||
).animate(CurvedAnimation(parent: _controller!, curve: Curves.easeInOut));
|
||||
|
||||
_controller!.repeat(reverse: true);
|
||||
|
||||
|
||||
_tcpStatusCubit.stream.listen((state) {
|
||||
if (state.status != TcpConnectionStatus.disconnected) {
|
||||
_hasActivity = true;
|
||||
@@ -95,28 +98,32 @@ class _TcpStatusIndicatorState extends State<TcpStatusIndicator>
|
||||
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation!,
|
||||
builder: (context, child) {
|
||||
final opacity = shouldAnimate ? _animation!.value : 1.0;
|
||||
return Container(
|
||||
width: widget.size,
|
||||
height: widget.size,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(opacity),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: state.status == TcpConnectionStatus.connected
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Colors.green.withOpacity(0.5 * opacity),
|
||||
blurRadius: 6 * opacity,
|
||||
spreadRadius: 2 * opacity,
|
||||
),
|
||||
]
|
||||
: [],
|
||||
),
|
||||
);
|
||||
},
|
||||
child: InkWell(
|
||||
onTap: widget.onTap,
|
||||
borderRadius: BorderRadius.circular(widget.size / 2),
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation!,
|
||||
builder: (context, child) {
|
||||
final opacity = shouldAnimate ? _animation!.value : 1.0;
|
||||
return Container(
|
||||
width: widget.size,
|
||||
height: widget.size,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(opacity),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: state.status == TcpConnectionStatus.connected
|
||||
? [
|
||||
BoxShadow(
|
||||
color: Colors.green.withOpacity(0.5 * opacity),
|
||||
blurRadius: 6 * opacity,
|
||||
spreadRadius: 2 * opacity,
|
||||
),
|
||||
]
|
||||
: [],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user