startPreview method

Future<void> startPreview()

Starts capturing and drawing preview frames to the screen.

Preview will not actually start until a texture is attached with attachPreviewTexture.

If setPreviewCallback or setOneShotPreviewCallback were called, PreviewCallback.onPreviewFrame will be called when preview data becomes available.

Throws a PlatformException if starting preview fails; usually this would be because of a hardware or other low-level error, or because release has been called on this Camera instance. The QCIF (176x144) exception mentioned in CameraParameters.setPreviewSize and CameraParameters.setPictureSize can also cause this exception be thrown.

Implementation

Future<void> startPreview() => _channel.$startPreview(this);