Camera on all 6 platforms: photos, videos, QR/barcode scanning (live and from images). Needs dart run u:app permission add camera (+ microphone for video). final code = await UCamera.scan();
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
-
controller(
{UCameraConfig config = const UCameraConfig()}) → UCameraController -
A controller for your own camera screen; show it with UCameraPreview and dispose it.
final c = UCamera.controller(); await c.initialize(); -
decodePixels(
Uint8List pixels, int width, int height, {bool bgra = true, int rowStride = 0, UCodeScanOptions options = const UCodeScanOptions()}) → List< UCode> - Finds codes in raw RGBA/BGRA pixels, pure Dart (works in isolates and on the web).
-
devices(
) → Future< List< UCameraDevice> > - Every camera (front, back, external) with its capabilities.
-
isSupported(
) → Future< bool> - True when this platform/browser has a camera implementation.
-
open(
{UCameraOptions options = const UCameraOptions(), dynamic action(List< UFileData> )?}) → Future<List< UFileData> > -
Opens the full camera screen and returns everything captured.
await UCamera.open() -
openSettings(
) → Future< bool> - Opens the app's settings to grant a denied permission.
-
permission(
) → Future< UCameraPermissionState> - Camera (and microphone) permission right now.
-
recordVideo(
{UCameraOptions options = const UCameraOptions(), dynamic action(UFileData?)?}) → Future< UFileData?> -
Records one video. Needs
permission add camera microphone. -
requestPermission(
{bool audio = false}) → Future< UCameraPermissionState> -
Asks for camera permission;
audioalso asks for the microphone.await UCamera.requestPermission() -
scan(
{String? title, List< UCodeFormat> formats = const <UCodeFormat>[], String? hintText, bool showGalleryButton = false, UScanSpeed speed = UScanSpeed.normal}) → Future<String?> -
Opens the scanner and returns the first code's text, or null when closed.
final String? text = await UCamera.scan(formats: [UCodeFormat.qrCode]) -
scanCode(
{String? title, List< UCodeFormat> formats = const <UCodeFormat>[], String? hintText}) → Future<UCode?> - Opens the scanner and returns the full result (format, corners, raw bytes).
-
scanImage(
{String? path, Uint8List? bytes, UCodeScanOptions options = const UCodeScanOptions(multiple: true), UScanEngine engine = UScanEngine.auto}) → Future< List< UCode> > -
Finds every QR/barcode in an image file or bytes (all platforms, no camera needed).
await UCamera.scanImage(bytes: imageBytes) -
takePhoto(
{UCameraOptions options = const UCameraOptions(), dynamic action(UFileData?)?}) → Future< UFileData?> -
Takes one photo.
final UFileData? photo = await UCamera.takePhoto(); -
takePhotos(
{int maxCount = 0, UCameraOptions options = const UCameraOptions(), dynamic action(List< UFileData> )?}) → Future<List< UFileData> > -
Takes several photos in one session;
maxCount0 = unlimited.