Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2024-09-24 15:32:02 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3ec0dc12833ee219f275bfb9086c2e0eb3525f74
3ec0dc12
1 parent
4d92d5de
publis barcode error event for Android
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeHandler.kt
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
android/src/main/kotlin/dev/steenbakker/mobile_scanner/BarcodeHandler.kt
View file @
3ec0dc1
...
...
@@ -24,6 +24,12 @@ class BarcodeHandler(binaryMessenger: BinaryMessenger) : EventChannel.StreamHand
}
}
fun publishError(errorCode: String, errorMessage: String, errorDetails: Any?) {
Handler(Looper.getMainLooper()).post {
eventSink?.error(errorCode, errorMessage, errorDetails)
}
}
override fun onListen(event: Any?, eventSink: EventChannel.EventSink?) {
this.eventSink = eventSink
}
...
...
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
View file @
3ec0dc1
...
...
@@ -66,10 +66,7 @@ class MobileScannerHandler(
}
private val errorCallback: MobileScannerErrorCallback = {error: String ->
barcodeHandler.publishEvent(mapOf(
"name" to MobileScannerErrorCodes.BARCODE_ERROR,
"data" to error,
))
barcodeHandler.publishError(MobileScannerErrorCodes.BARCODE_ERROR, error, null)
}
private var methodChannel: MethodChannel? = null
...
...
Please
register
or
login
to post a comment