Merge branch 'feature/my' of http://1.95.137.212:57001/APP/FlutterApp into feature/my
This commit is contained in:
@@ -398,4 +398,13 @@ class DevicesCubit extends Cubit<DevicesState> {
|
||||
emit(state.copyWith(appState: appState));
|
||||
(_routePlanningUseCase as dynamic).repository.setAppState(appState);
|
||||
}
|
||||
|
||||
void finishWork() {
|
||||
emit(state.copyWith(isFinshWork: true));
|
||||
}
|
||||
|
||||
/// 重置完成状态
|
||||
void resetWorkStatus() {
|
||||
emit(state.copyWith(isFinshWork: false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class DevicesState extends Equatable {
|
||||
final List<Map<String, dynamic>>? pathData;
|
||||
final List<DeviceAddPathPointModel>? generatedPath; // 新增字段
|
||||
final AppState appState;
|
||||
final bool isFinshWork;
|
||||
|
||||
|
||||
|
||||
@@ -42,6 +43,7 @@ class DevicesState extends Equatable {
|
||||
this.pathData,
|
||||
this.generatedPath,
|
||||
this.appState = AppState.none,
|
||||
this.isFinshWork = false,
|
||||
});
|
||||
|
||||
// 使用 copyWith 方便局部更新状态
|
||||
@@ -57,6 +59,7 @@ class DevicesState extends Equatable {
|
||||
List<Map<String, dynamic>>? pathData,
|
||||
List<DeviceAddPathPointModel>? generatedPath,
|
||||
AppState? appState,
|
||||
bool? isFinshWork,
|
||||
}) {
|
||||
return DevicesState(
|
||||
devices: devices ?? this.devices,
|
||||
@@ -70,6 +73,7 @@ class DevicesState extends Equatable {
|
||||
operationType: operationType ?? this.operationType, // 更新操作类型
|
||||
generatedPath: generatedPath ?? this.generatedPath, // 更新生成的路径数据
|
||||
appState: appState ?? this.appState, // 更新应用状态
|
||||
isFinshWork: isFinshWork ?? this.isFinshWork,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -83,5 +87,6 @@ class DevicesState extends Equatable {
|
||||
operationType,
|
||||
generatedPath,
|
||||
appState,
|
||||
isFinshWork
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user