feat: 修复了插件需要外部Provider的问题;加上了一个简易的车控状态返回

This commit is contained in:
2025-09-18 15:53:39 +08:00
parent 922818f39f
commit b84899ece3
16 changed files with 404 additions and 87 deletions

View File

@@ -0,0 +1,24 @@
import '../enums/vehicle_command_type.dart';
import '../services/command_service.dart';
import 'easy_bloc.dart';
import 'command_state.dart';
class AIChatCommandCubit extends EasyCubit<AIChatCommandState> {
AIChatCommandCubit() : super(const AIChatCommandState());
// 重置状态
void reset() {
emit(const AIChatCommandState());
}
// 生成唯一命令ID
String _generateCommandId() {
return '${DateTime.now().millisecondsSinceEpoch}_${state.commandType?.name ?? 'unknown'}';
}
// 检查当前是否有命令在执行
bool get isExecuting => state.status == AIChatCommandStatus.executing;
// 获取当前命令ID
String? get currentCommandId => state.commandId;
}