stop method

Future<void> stop()

Stop camera and inference operations.

This method stops the camera preview and inference processing, but keeps the view in a state where it could potentially be restarted. For complete cleanup, the widget disposal process will call this automatically plus additional cleanup.

Example:

// Stop camera and inference temporarily
await controller.stop();

Implementation

Future<void> stop() async {
  if (_methodChannel == null) {
    logInfo(
      'YOLOViewController: Warning - Cannot stop, view not yet created',
    );
    return;
  }
  try {
    await _methodChannel!.invokeMethod('stop');
    logInfo('YOLOViewController: Camera and inference stopped successfully');
  } catch (e) {
    logInfo('YOLOViewController: Error stopping camera and inference: $e');
  }
}