takePicture method

Future<XFile> takePicture({
  1. DeviceOrientation? captureOrientation,
})

Capture a still. captureOrientation is the orientation to embed in the resulting JPEG; defaults to XSensor.orientation read at call time. Tests pass an explicit value to keep the assertion deterministic.

Implementation

Future<XFile> takePicture({DeviceOrientation? captureOrientation}) async {
  final handle = _requireHandle('takePicture');
  final orientation = captureOrientation ?? XSensor.orientation;
  return XCameraBackend.instance.takePicture(handle, orientation);
}