Skip to content

Instantly share code, notes, and snippets.

@DUMA042
Created January 10, 2025 23:13
Show Gist options
  • Save DUMA042/e8fe96fcb1d486b230c04149fd3c9551 to your computer and use it in GitHub Desktop.
Save DUMA042/e8fe96fcb1d486b230c04149fd3c9551 to your computer and use it in GitHub Desktop.
// If a QR/barcode has been detected, trigger the callback
if (qrCodeDetected) {
LaunchedEffect(Unit) {
// Delay for a short duration to allow recomposition
delay(100) // Adjust delay as needed
// Call the callback with the detected barcode value
onQrCodeDetected(barcode ?: "")
}
// Draw a rectangle around the detected barcode
DrawRectangle(rect = boundingRect)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment