BarcodeScannerCustomUI

@Composable
actual fun BarcodeScannerCustomUI(modifier: Modifier, detectionEnabled: Boolean, flashEnabled: Boolean, @FloatRange(from = 0.0, to = 1.0) cameraZoomFactor: Float, cameraZoomRange: CameraZoomRange, cameraModule: CameraModule, minFocusDistanceLock: Boolean, scannerConfiguration: BarcodeScannerConfiguration, arOverlayConfiguration: ArOverlayConfiguration, finderConfiguration: FinderViewConfiguration, cameraLiveScannerResolution: CameraLiveScannerResolution, hardwareButtonsEnabled: Boolean, onBarcodesDetected: (List<BarcodeItem>) -> Unit?, onBarcodeTap: (barcode: BarcodeItem, highlighted: Boolean) -> Unit?, onError: (error: Result.Failure) -> Unit?)
@Composable
expect fun BarcodeScannerCustomUI(modifier: Modifier, detectionEnabled: Boolean = true, flashEnabled: Boolean = false, @FloatRange(from = 0.0, to = 1.0) cameraZoomFactor: Float = 0.0f, cameraZoomRange: CameraZoomRange = CameraZoomRange(), cameraModule: CameraModule = CameraModule.BACK, minFocusDistanceLock: Boolean = false, scannerConfiguration: BarcodeScannerConfiguration = BarcodeScannerConfiguration(), arOverlayConfiguration: ArOverlayConfiguration = ArOverlayConfiguration(), finderConfiguration: FinderViewConfiguration = FinderViewConfiguration(), cameraLiveScannerResolution: CameraLiveScannerResolution = CameraLiveScannerResolution.FULL_HD, hardwareButtonsEnabled: Boolean = true, onBarcodesDetected: (List<BarcodeItem>) -> Unit? = null, onBarcodeTap: (barcode: BarcodeItem, highlighted: Boolean) -> Unit? = null, onError: (error: Result.Failure) -> Unit? = null)

A composable function that displays a barcode scanner view with the specified configuration and callbacks for barcode detection, barcode tap events, errors, and AR overlay styling.

Parameters

modifier

The modifier to be applied to the barcode scanner view.

detectionEnabled

Enable or disable barcode detection. If disabled, the camera preview is active but no barcodes will be detected.

flashEnabled

Whether flash is toggled on or off.

cameraZoomFactor

The relative initial zoom level of the camera in the range (0,1), where 0 is zoomed out and 1 is zoomed in.

cameraZoomRange

The range of valid camera zoom factors. See CameraZoomRange.

cameraModule

The camera module to be used for barcode scanning.

minFocusDistanceLock

Lock focus distance within the minimum possible range.

scannerConfiguration

Configuration for the barcode scanner. All barcodes parameters, types. etc. See BarcodeScannerConfiguration.

arOverlayConfiguration

Configuration for the AR overlay displayed on top of the detected barcodes in the camera preview. See ArOverlayConfiguration.

finderConfiguration

Configuration properties of the finder overlay. See FinderViewConfiguration.

cameraLiveScannerResolution

The camera resolution to be used for barcode scanning.

hardwareButtonsEnabled

Controls whether the hardware volume buttons and the new hardware camera control button should snap or not. Available in iOS 17.2 and later.

onBarcodesDetected

A callback function that is invoked when barcodes are detected. It receives a list of detected BarcodeItems.

onBarcodeTap

A callback function that is invoked when a barcode is tapped. It receives the tapped BarcodeItem and a boolean indicating whether the barcode is highlighted or not.

onError

A callback function that is invoked when an error occurs during barcode scanning. It receives a Result.Failure object containing error details.

@Composable
actual fun BarcodeScannerCustomUI(modifier: Modifier, detectionEnabled: Boolean, flashEnabled: Boolean, @FloatRange(from = 0.0, to = 1.0) cameraZoomFactor: Float, cameraZoomRange: CameraZoomRange, cameraModule: CameraModule, minFocusDistanceLock: Boolean, scannerConfiguration: BarcodeScannerConfiguration, arOverlayConfiguration: ArOverlayConfiguration, finderConfiguration: FinderViewConfiguration, cameraLiveScannerResolution: CameraLiveScannerResolution, hardwareButtonsEnabled: Boolean, onBarcodesDetected: (List<BarcodeItem>) -> Unit?, onBarcodeTap: (barcode: BarcodeItem, highlighted: Boolean) -> Unit?, onError: (error: Result.Failure) -> Unit?)