远程遥控开发中

This commit is contained in:
CC
2026-01-21 13:27:55 +08:00
parent 32b702fb6d
commit 8c39f0daf8
45 changed files with 1994 additions and 245 deletions

View File

@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:maibu_satabot_v2/features/remote_control/data/models/running_status_model.dart';
import 'package:maibu_satabot_v2/features/remote_control/presentation/bloc/remote_control_state.dart';
import '../../domain/entities/machine_control_status_entity.dart';
@@ -11,7 +12,12 @@ class RemoteControlCubit extends Cubit<RemoteControlState> {
Timer? _timer;
RemoteControlCubit(this._repository)
: super(RemoteControlState(controlEntity: MachineControlStatusEntity())) {
: super(
RemoteControlState(
controlEntity: MachineControlStatusEntity(),
runningStatusModel: RunningStatusModel(),
),
) {
_initPacketListener();
}
@@ -78,6 +84,10 @@ class RemoteControlCubit extends Cubit<RemoteControlState> {
// _sendProtocolData(0x12, ...);
}
void toggleLeftPip() => emit(state.copyWith(showLeftPip: !state.showLeftPip));
void toggleRightPip() =>
emit(state.copyWith(showRightPip: !state.showRightPip));
@override
Future<void> close() {
_timer?.cancel(); // 退出页面时务必销毁定时器