setOneShotPreviewCallback method

Future<void> setOneShotPreviewCallback(
  1. PreviewCallback callback
)

Installs a callback to be invoked for the next preview frame in addition to displaying it on the screen.

After one invocation, the callback is cleared. This method can be called any time, even when preview is live. Any other preview callbacks are overridden.

If you are using the preview data to create video or still images, strongly consider using a sound to properly indicate image capture or recording start/stop to the user.

Throws PlatformException if release has been called on this Camera instance.

Implementation

Future<void> setOneShotPreviewCallback(PreviewCallback callback) {
  PreviewCallback._channel.$create$(
    callback,
    $owner: false,
    onPreviewFrame: callback.onPreviewFrame,
  );
  return _channel.$setOneShotPreviewCallback(this, callback);
}