Stop the scanner when the screen dispose
This commit is contained in:
+6
@@ -24,6 +24,12 @@ fun PreviewScreen(
|
|||||||
var lottieFileUrl by remember { mutableStateOf("") }
|
var lottieFileUrl by remember { mutableStateOf("") }
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
|
DisposableEffect(true) {
|
||||||
|
onDispose {
|
||||||
|
codeScanner?.stopPreview()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Scaffold(
|
Scaffold(
|
||||||
content = {
|
content = {
|
||||||
if (lottieFileUrl.isNotEmpty()) {
|
if (lottieFileUrl.isNotEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user