UCameraUtils class abstract

Helpers shared by the camera page, the scanner and any app-level UI built on UCameraController. All of it is pure Dart, so it behaves the same on every platform.

Constructors

UCameraUtils()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

centeredScanWindow(Size bounds, Size size) → Rect
Normalized scan window for a centered rectangle of size inside bounds.
cropGray(UGrayImage image, Rect normalizedRegion) → UGrayImage
Crops a frame to a normalized region before decoding, the cheapest way to make scanning faster and more accurate.
denormalizePoint({required Offset normalized, required Size widgetSize, required UCameraSize previewSize, BoxFit fit = BoxFit.cover, bool mirrored = false}) → Offset
Inverse of normalizePoint: places a normalized point back on the widget.
extensionOf(String source, String fallback) → String
flashIcon(UFlashMode mode) → IconData
formatBytes(int bytes) → String
formatDuration(Duration duration) → String
mm:ss, or h:mm:ss past an hour — used by the recording indicator.
frameRectToWidget({required Rect frameRect, required Size widgetSize, required UCameraSize previewSize, BoxFit fit = BoxFit.cover, bool mirrored = false}) → Rect
Converts a rectangle in frame pixels to widget coordinates, which is what a tracking overlay needs to draw a box around a detected symbol.
grayToRgba(UGrayImage image) → Uint8List
Packs a grayscale buffer into ARGB pixels, ready for decodeImageFromPixels.
joinStructuredAppend(Iterable<UCode> codes) → String?
Splits a multi-part QR payload set (structured append) back into one string once every part has been scanned; returns null while parts are missing.
nextFlashMode(UFlashMode current, {bool includeTorch = true}) → UFlashMode
normalizePoint({required Offset local, required Size widgetSize, required UCameraSize previewSize, BoxFit fit = BoxFit.cover, bool mirrored = false}) → Offset
Maps a tap inside a preview box to the normalized (0..1) sensor point the controller expects, accounting for the preview being letterboxed or cropped by fit and for a mirrored front camera.
pickDevice(List<UCameraDevice> devices, {UCameraFacing facing = UCameraFacing.back, UCameraLens? lens}) → UCameraDevice?
Picks the device closest to facing, preferring the given lens.
resolutionLabel(UCameraResolution resolution) → String
rotateGray(UGrayImage image, int degrees) → UGrayImage
Rotates a grayscale buffer clockwise by 90, 180 or 270 degrees.
temporaryPath(String extension) → Future<String>
A timestamped path inside the app's temporary directory.
toFileData(UCapturedPhoto photo) → UFileData
Wraps a captured photo as the UFileData the rest of the package passes around, so camera output flows through uploads and pickers unchanged.
videoToFileData(UCapturedVideo video, {Uint8List? bytes}) → UFileData