DualCameraController class

Controls a dual-camera (front+back simultaneous) capture session.

final cam = DualCameraController();
if (!await DualCameraController.isSupported()) { /* single-cam fallback */ }
await cam.initialize(layout: DualLayout.pictureInPicture());
// DualCameraPreview(cam) renders the live composite
await cam.startRecording();
final clip = await cam.stopRecording();
await cam.dispose();
Inheritance

Constructors

DualCameraController()

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ DualCameraValue
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>
Discards any resources used by the object.
override
getExposureRange({bool isFront = false}) → Future<Map<String, double>>
initialize({LayoutConfig? layout, DualResolution resolution = DualResolution.hd720, VideoCodec codec = VideoCodec.h264, bool recordAudio = true, Duration maxDuration = Duration.zero}) → Future<void>
Bring up the session + compositor and start the live preview.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setExposureOffset(double offset, {bool isFront = false}) → Future<double>
setFocusPoint(Offset point, {bool isFront = false}) → Future<void>
setLayout(LayoutConfig layout) → Future<void>
Update the layout geometry live.
startRecording() → Future<void>
stopRecording() → Future<String>
Stop recording; returns the composited .mp4 path.
swapPrimary() → Future<void>
Flip which feed is full-frame, live.
takePhoto() → Future<String>
Capture a composited still; returns the image path.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

isSupported() → Future<bool>
Convenience wrapper over probeSupport.
probeSupport() → Future<CameraCapabilities>
Probe whether this device can run front+back concurrently without bringing the pipeline up. Cheap; safe to call before initialize.