CameraPlugin class Null safety

The web implementation of CameraPlatform.

This class implements the package:camera functionality for the web.

Inheritance

Constructors

CameraPlugin({required CameraService cameraService})
Creates a new instance of CameraPlugin with the given cameraService.

Properties

cameraEventStreamController StreamController<CameraEvent>
The controller used to broadcast different camera events.
final
cameras Map<int, Camera>
The cameras managed by the CameraPlugin.
final
camerasMetadata Map<CameraDescription, CameraMetadata>
Metadata associated with each camera description. Populated in availableCameras.
final
hashCode int
The hash code for this object.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
window Window?
The current browser window used to access media devices.
read / write

Methods

availableCameras() Future<List<CameraDescription>>
Completes with a list of available cameras.
override
buildPreview(int cameraId) Widget
Returns a widget showing a live camera preview.
override
createCamera(CameraDescription cameraDescription, ResolutionPreset? resolutionPreset, {bool enableAudio = false}) Future<int>
Creates an uninitialized camera instance and returns the cameraId.
override
dispose(int cameraId) Future<void>
Releases the resources of this camera.
override
getCamera(int cameraId) → Camera
Returns a camera for the given cameraId.
getExposureOffsetStepSize(int cameraId) Future<double>
Gets the supported step size for exposure offset for the selected camera in EV units.
override
getMaxExposureOffset(int cameraId) Future<double>
Gets the maximum supported exposure offset for the selected camera in EV units.
override
getMaxZoomLevel(int cameraId) Future<double>
Gets the maximum supported zoom level for the selected camera.
override
getMinExposureOffset(int cameraId) Future<double>
Gets the minimum supported exposure offset for the selected camera in EV units.
override
getMinZoomLevel(int cameraId) Future<double>
Gets the minimum supported zoom level for the selected camera.
override
initializeCamera(int cameraId, {ImageFormatGroup imageFormatGroup = ImageFormatGroup.unknown}) Future<void>
Initializes the camera on the device.
override
lockCaptureOrientation(int cameraId, DeviceOrientation orientation) Future<void>
Locks the capture orientation.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
onCameraClosing(int cameraId) Stream<CameraClosingEvent>
The camera started to close.
override
onCameraError(int cameraId) Stream<CameraErrorEvent>
The camera experienced an error.
override
onCameraInitialized(int cameraId) Stream<CameraInitializedEvent>
The camera has been initialized.
override
onCameraResolutionChanged(int cameraId) Stream<CameraResolutionChangedEvent>
Emits an empty stream as there is no event corresponding to a change in the camera resolution on the web.
override
onDeviceOrientationChanged() Stream<DeviceOrientationChangedEvent>
The ui orientation changed.
override
onStreamedFrameAvailable(int cameraId, {CameraImageStreamOptions? options}) Stream<CameraImageData>
A new streamed frame is available.
inherited
onVideoRecordedEvent(int cameraId) Stream<VideoRecordedEvent>
The camera finished recording a video.
override
pausePreview(int cameraId) Future<void>
Pause the active preview on the current frame for the selected camera.
override
pauseVideoRecording(int cameraId) Future<void>
Pause video recording.
override
prepareForVideoRecording() Future<void>
Prepare the capture session for video recording.
override
resumePreview(int cameraId) Future<void>
Resume the paused preview for the selected camera.
override
resumeVideoRecording(int cameraId) Future<void>
Resume video recording after pausing.
override
setExposureMode(int cameraId, ExposureMode mode) Future<void>
Sets the exposure mode for taking pictures.
override
setExposureOffset(int cameraId, double offset) Future<double>
Sets the exposure offset for the selected camera.
override
setExposurePoint(int cameraId, Point<double>? point) Future<void>
Sets the exposure point for automatically determining the exposure values.
override
setFlashMode(int cameraId, FlashMode mode) Future<void>
Sets the flash mode for the selected camera. On Web FlashMode.auto corresponds to FlashMode.always.
override
setFocusMode(int cameraId, FocusMode mode) Future<void>
Sets the focus mode for taking pictures.
override
setFocusPoint(int cameraId, Point<double>? point) Future<void>
Sets the focus point for automatically determining the focus values.
override
setZoomLevel(int cameraId, double zoom) Future<void>
Set the zoom level for the selected camera.
override
startVideoCapturing(VideoCaptureOptions options) Future<void>
Starts a video recording and/or streaming session.
override
startVideoRecording(int cameraId, {Duration? maxVideoDuration}) Future<void>
Starts a video recording.
override
stopVideoRecording(int cameraId) Future<XFile>
Stops the video recording and returns the file where it was saved.
override
takePicture(int cameraId) Future<XFile>
Captures an image and returns the file where it was saved.
override
toString() String
A string representation of this object.
inherited
unlockCaptureOrientation(int cameraId) Future<void>
Unlocks the capture orientation.
override

Operators

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

Static Methods

registerWith(Registrar registrar) → void
Registers this class as the default instance of CameraPlatform.