CameraController class

Controls a device camera.

Use availableCameras to get a list of available cameras.

Before using a CameraController a call to initialize must complete.

To show the camera preview on the screen use a CameraPreview widget.

Inheritance

Constructors

CameraController(CameraDescription description, ResolutionPreset resolutionPreset, {bool enableAudio = true, bool autoFocusEnabled = true, FlashMode flashMode = FlashMode.off, dynamic enableAutoExposure = true})

Properties

autoFocusEnabled → bool
Whether the auttoFocus is enabled
final
description → CameraDescription
final
enableAudio → bool
Whether to include audio when recording a video.
final
enableAutoExposure → dynamic
final
flashMode → FlashMode
final
hasFlash → Future<bool?>
check if the device has a flash.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
resolutionPreset → ResolutionPreset
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ CameraValue
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → Future<void>
Releases the resources of this camera.
override
initialize() → Future<void>
Initializes the camera on the device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pauseVideoRecording() → Future<void>
Pause video recording.
prepareForVideoRecording() → Future<void>
Prepare the capture session for video recording.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resumeVideoRecording() → Future<void>
Resume video recording after pausing.
setAutoFocus(bool newValue) → Future<void>
setFlashMode(FlashMode flashMode) → Future<void>
setPointOfInterest(Offset offset) → Future<Null>
startImageStream(onLatestImageAvailable onAvailable) → Future<void>
Start streaming images from platform camera.
startVideoRecording(String filePath) → Future<void>
Start a video recording and save the file to path.
stopImageStream() → Future<void>
Stop streaming images from platform camera.
stopVideoRecording() → Future<void>
Stop recording.
takePicture(String path) → Future<void>
Captures an image and saves it to path.
toString() → String
A string representation of this object.
inherited
zoom(double step) → Future<void>
change zoom by specific step.

Operators

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