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

@@ -1,11 +1,15 @@
import '../enums/vehicle_command_type.dart';
/// 车辆控制命令类
class VehicleCommand {
final VehicleCommandType type;
final Map<String, dynamic>? params;
final String error;
late String commandId;
VehicleCommand({required this.type, this.params, this.error = ''});
VehicleCommand({required this.type, this.params, this.error = ''}) {
commandId = DateTime.now().millisecondsSinceEpoch.toString();
}
// 从字符串创建命令用于从API响应解析
factory VehicleCommand.fromString(