补充generatePath的cubit层
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:maibu_satabot_v2/features/devices/domain/entities/device_entity.dart';
|
||||
|
||||
import '../../data/models/device_add_path_point_model.dart';
|
||||
enum DeviceOperationType {
|
||||
none, // 无操作
|
||||
unbind, // 解绑设备
|
||||
@@ -17,6 +19,8 @@ class DevicesState extends Equatable {
|
||||
final List<Map<String, dynamic>>? workRecords;
|
||||
final DeviceOperationType operationType; // 标记当前操作类型
|
||||
final List<Map<String, dynamic>>? pathData;
|
||||
final List<DeviceAddPathPointModel>? generatedPath; // 新增字段
|
||||
|
||||
|
||||
|
||||
const DevicesState({
|
||||
@@ -29,6 +33,7 @@ class DevicesState extends Equatable {
|
||||
this.workRecords,
|
||||
this.operationType = DeviceOperationType.none, // 默认无操作
|
||||
this.pathData,
|
||||
this.generatedPath,
|
||||
});
|
||||
|
||||
// 使用 copyWith 方便局部更新状态
|
||||
@@ -42,6 +47,7 @@ class DevicesState extends Equatable {
|
||||
List<Map<String, dynamic>>? workRecords,
|
||||
DeviceOperationType? operationType,
|
||||
List<Map<String, dynamic>>? pathData,
|
||||
List<DeviceAddPathPointModel>? generatedPath,
|
||||
}) {
|
||||
return DevicesState(
|
||||
devices: devices ?? this.devices,
|
||||
|
||||
Reference in New Issue
Block a user