YOLOViewController class

Controls a YOLOView imperatively: thresholds, camera, zoom, streaming.

Constructors

YOLOViewController()

Properties

confidenceThreshold double
no setter
focusEvents Stream<Offset>
Emits the normalized (0..1) view-relative tap-to-focus point.
no setter
hashCode int
The hash code for this object.
no setterinherited
iouThreshold double
no setter
isInitialized bool
no setter
isTorchEnabled bool
Whether the torch (flashlight) is currently enabled, per the last setTorchMode/toggleTorch call.
no setter
lensEvents Stream<String>
Emits the label of the currently selected lens whenever it changes.
no setter
numItemsThreshold int
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
zoomEvents Stream<double>
Emits the native zoom factor whenever it changes (e.g. via pinch).
no setter

Methods

captureFrame() Future<Uint8List?>
capturePhoto({bool withOverlays = true}) Future<Uint8List?>
Captures a still photo from the live preview.
dispose() → void
Releases the broadcast stream controllers owned by this controller.
getAvailableLenses() Future<List<LensInfo>>
Returns the lenses the active device exposes (back camera lens cluster).
init(MethodChannel methodChannel, int viewId) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onNativeEvent(Map event) → void
Routes a typed native event (zoom/lens/focus) to the matching stream.
pause() Future<void>
Pause the preview. On iOS this snapshots the next frame into the native share-image cache before stopping the session (so capturePhoto after pause returns the frozen frame); on Android it's a stop() alias.
resetTorchState() → void
Resets the cached torch state to off without a platform call. Use after an operation where the platform drops the torch on its own (e.g. switching the camera input), so isTorchEnabled stays in sync.
restartCamera() Future<void>
resume() Future<void>
Resume after pause. iOS clears the cached share frame and restarts the session; Android aliases to restartCamera().
setConfidenceThreshold(double threshold) Future<void>
setIoUThreshold(double threshold) Future<void>
setLens(double zoomFactor) Future<void>
Snaps the active camera to the lens whose native zoom factor is zoomFactor.
setNumItemsThreshold(int numItems) Future<void>
setShowOverlays(bool visible) Future<void>
Shows or hides native prediction overlays without changing inference callbacks.
setStreamingConfig(YOLOStreamingConfig config) Future<void>
setThresholds({double? confidenceThreshold, double? iouThreshold, int? numItemsThreshold}) Future<void>
setTorchMode(bool enabled) Future<void>
Turns the active camera's torch (flashlight) on or off. The platform returns the actual resulting torch state, which is cached in isTorchEnabled — so the cache stays correct even when the call fails or the active camera has no torch (e.g. most front cameras). On a swallowed platform error the cached state is left unchanged.
setZoomLevel(double zoomLevel) Future<void>
stop() Future<void>
switchCamera() Future<void>
switchModel(String modelPath, [YOLOTask? task]) Future<void>
tapToFocus(double x, double y) Future<void>
Requests focus + exposure at the view-relative point (x, y in 0..1).
toggleTorch() Future<void>
Toggles the torch (flashlight) between on and off. See setTorchMode and isTorchEnabled.
toString() String
A string representation of this object.
inherited
zoomIn() Future<void>
zoomOut() Future<void>

Operators

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