FlutterLiteCameraWeb class
A web implementation of FlutterLiteCameraPlatform backed by
navigator.mediaDevices.getUserMedia.
The preview is rendered with a hidden HTMLVideoElement hosted in a web
platform view, so frames never cross a platform channel at all —
buildPreview returns an HtmlElementView instead of a Texture.
captureFrame draws the current video frame onto an offscreen canvas on
demand and returns RGB888 bytes, the same contract as the native
platforms.
- Inheritance
-
- Object
- PlatformInterface
- FlutterLiteCameraPlatform
- FlutterLiteCameraWeb
Constructors
- FlutterLiteCameraWeb()
- Constructs a FlutterLiteCameraWeb.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
buildPreview(
int textureId) → Widget -
Builds the widget that renders the preview started with startPreview.
override
-
captureFrame(
{int byteOrder = 2}) → Future< Map< String, dynamic> > -
Captures a single RGB frame from the camera.
override
-
getDeviceList(
) → Future< List< String> > -
Lists available video capture devices.
override
-
getHeight(
) → Future< int> -
The actual capture height negotiated with the device, in pixels
(0 when no camera is open).
override
-
getRotation(
) → Future< int> -
Returns the clockwise rotation in degrees (0, 90, 180, or 270) that must
be applied to the camera preview and any coordinates derived from
captureFrame so they appear upright for the current device orientation.
override
-
getWidth(
) → Future< int> -
The actual capture width negotiated with the device, in pixels
(0 when no camera is open).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
int index) → Future< bool> -
Opens the camera with the specified index.
override
-
release(
) → Future< void> -
Releases the camera and associated resources.
override
-
setResolution(
int width, int height) → Future< bool> -
Sets the capture resolution in pixels.
override
-
setResolutionPreset(
ResolutionPreset preset) → Future< bool> -
Convenience for setResolution using a ResolutionPreset target.
inherited
-
startPreview(
) → Future< int> -
Starts the native preview stream and returns a texture id.
override
-
stopPreview(
) → Future< void> -
Stops the preview stream and unregisters the texture.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerWith(
Registrar registrar) → void - Registers this class as the default instance of FlutterLiteCameraPlatform.