1更新无人机的摄像头视频显示的条件为在离线情况下的自动刷新+下拉刷新的机制。

2更新优化去除原有路径规划的初始化阶段的获取设备的接口请求,改为使用新的 targetDevice。
3修改无人机机场的在线状态简化为在线和离线。去掉机场二字。
4.更新同一账号同时段登录,被强制下线的友好提示!
This commit is contained in:
2026-06-17 13:46:30 +08:00
parent 71aea48d9f
commit 443ce601a0
6 changed files with 192 additions and 666 deletions

View File

@@ -9,6 +9,7 @@ import 'package:maibu_satabot_v2/core/network/tcp/tcp_client.dart';
import 'package:maibu_satabot_v2/features/devices/presentation/bloc/devices_cubit.dart';
import 'package:maibu_satabot_v2/features/devices/presentation/bloc/devices_state.dart'; // 👈 必须加
import 'package:maibu_satabot_v2/features/remote_control/domain/repositories/remote_control_repository.dart';
import 'package:maibu_satabot_v2/features/remote_control/presentation/bloc/remote_control_cubit.dart';
import '../../../devices/domain/entities/device_entity.dart';
import '../bloc/permission_request_bloc.dart';
@@ -44,6 +45,17 @@ class _HomePageState extends State<HomePage> {
final devicesCubit = context.read<DevicesCubit>();
// 🔥 修复:检查是否已有 targetDevice,如果有则不需要加载设备列表
final remoteControlState = context.read<RemoteControlCubit>().state;
if (remoteControlState.targetDevice != null) {
debugPrint('✅ [HomePage] 已有 targetDevice: ${remoteControlState.targetDevice!.deviceName},跳过设备列表加载');
setState(() {
_isDevicesLoading = false;
_hasLoadedDevices = true;
});
return;
}
// 🔥 关键:等待设备加载完成
await devicesCubit.fetchAllDevices(username);