stopScreenRecording method

Future<String?> stopScreenRecording()

停止屏幕录制

Implementation

Future<String?> stopScreenRecording() async {
  // try {
  //   if (!_isRecording) {
  //     TCICLog.info("No screen recording in progress", actionModule: ActionModule.tcicController.name, actionName: ActionName.stopScreenRecording.name);
  //     return null;
  //   }

  //   // 停止录制
  //   final filePath = await FlutterScreenRecording.stopRecordScreen;

  //   _isRecording = false;
  //   _recordingFilePath = null;

  //   if (filePath != null && filePath.isNotEmpty) {
  //     TCICToast.show(StringEnum.endScreenRecording);
  //     TCICLog.info("Screen recording completed successfully: $filePath", actionModule: ActionModule.tcicController.name, actionName: ActionName.stopScreenRecording.name);

  //     // 触发录制完成事件
  //     _eventbus.fire(MainEvent(type: EventTypeEnum.screenRecordingCompleted, data: {'filePath': filePath}));

  //     return filePath;
  //   } else {
  //     // TCICToast.show("停止屏幕录制失败");
  //     TCICLog.error("Failed to stop screen recording - no file path returned", actionModule: ActionModule.tcicController.name, actionName: ActionName.stopScreenRecording.name);
  //     return null;
  //   }
  // } catch (e) {
  //   _isRecording = false;
  //   _recordingFilePath = null;

  //   // TCICToast.show("停止屏幕录制时发生错误");
  //   TCICLog.error("Error stopping screen recording: $e", actionModule: ActionModule.tcicController.name, actionName: ActionName.stopScreenRecording.name);
  //   return null;
  // }
}