DVCameraController class final

A handle on one camera.

Made by DVBox.camera(...), which opens it when mounted and disposes it when the page goes. Read DVBox.camera(...).camera for the handle.

Constructors

DVCameraController(DVCameraBackend backend, {required DVCameraEnvironment environment, DVCameraLens lens = DVCameraLens.back, DVFlashMode flash = DVFlashMode.off, String? device})

Properties

backend → DVCameraBackend
final
capabilities → DVCameraCapabilities
no setter
device → String?
The DVCameraDevice id this camera opens, or null for the first device of its lens. Cleared by switchLens, which picks by lens.
no setter
environment → DVCameraEnvironment
final
error → DVMediaSignal<String?>
no setter
flash → DVMediaSignal<DVFlashMode>
no setter
hashCode → int
The hash code for this object.
no setterinherited
lens → DVMediaSignal<DVCameraLens>
no setter
previewSize → DVMediaSignal<(int, int)?>
The preview's width and height, once the device reports them.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → DVMediaSignal<DVCameraState>
no setter
torch → DVMediaSignal<bool>
no setter

Methods

devices() → Future<List<DVCameraDevice>>
The cameras the backend can open, for a picker.
dispose() → Future<void>
Closes the camera and releases everything. A recording in progress is aborted and its file deleted.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() → Future<void>
Asks permission and opens the camera. Throws DVCapturePermissionRefused (state DVCameraState.refused) or DVCameraUnavailable.
recordVideo({DVVideoQuality quality = DVVideoQuality.hd720, Duration? maxDuration}) → DVCaptureSession
Records video from this camera. Await the session for the file; hold it to stop. The same session DV.Platform.media.recordVideo returns, with the same refusals and the same private file.
setFlash(DVFlashMode mode) → void
setTorch(bool on) → Future<void>
switchLens([DVCameraLens? to]) → Future<void>
Switches to to, or to the next camera lens this device has. The screen is never the next lens: it is switched to by asking for it.
takePhoto() → Future<DVFile>
Takes a photo. The JPEG is written where only this application can read it.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited