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
2023-10-25 08:41:13 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2938eda4c7a09f8d344e969880825b75107f860f
2938eda4
1 parent
da349705
fix updateScanWindow() not completing on Android and MacOS
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
CHANGELOG.md
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
macos/Classes/MobileScannerPlugin.swift
CHANGELOG.md
View file @
2938eda
## NEXT
Bugs fixed:
*
Fixed the
`updateScanWindow()`
function not completing on Android and MacOS. (thanks @navaronbracke !)
## 3.5.1
Improvements:
*
The
`type` of an `Address`
is now non-null.
...
...
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerHandler.kt
View file @
2938eda
...
...
@@ -123,7 +123,7 @@ class MobileScannerHandler(
"analyzeImage" -> analyzeImage(call, result)
"setScale" -> setScale(call, result)
"resetScale" -> resetScale(result)
"updateScanWindow" -> updateScanWindow(call)
"updateScanWindow" -> updateScanWindow(call
, result
)
else -> result.notImplemented()
}
}
...
...
@@ -263,7 +263,9 @@ class MobileScannerHandler(
}
}
private fun updateScanWindow(call: MethodCall) {
private fun updateScanWindow(call: MethodCall
, result: MethodChannel.Result
) {
mobileScanner!!.scanWindow = call.argument<List<Float>?>("rect")
result.success(null)
}
}
...
...
macos/Classes/MobileScannerPlugin.swift
View file @
2938eda
...
...
@@ -66,7 +66,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
case
"stop"
:
stop
(
result
)
case
"updateScanWindow"
:
updateScanWindow
(
call
)
updateScanWindow
(
call
,
result
)
default
:
result
(
FlutterMethodNotImplemented
)
}
...
...
@@ -187,11 +187,12 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
}
func
updateScanWindow
(
_
call
:
FlutterMethodCall
)
{
func
updateScanWindow
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
argReader
=
MapArgumentReader
(
call
.
arguments
as?
[
String
:
Any
])
let
scanWindowData
:
Array
?
=
argReader
.
floatArray
(
key
:
"rect"
)
if
(
scanWindowData
==
nil
)
{
result
(
nil
)
return
}
...
...
@@ -202,6 +203,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
let
height
=
scanWindowData
!
[
3
]
-
minY
scanWindow
=
CGRect
(
x
:
minX
,
y
:
minY
,
width
:
width
,
height
:
height
)
result
(
nil
)
}
func
isBarCodeInScanWindow
(
_
scanWindow
:
CGRect
,
_
barcode
:
VNBarcodeObservation
,
_
inputImage
:
CGImage
)
->
Bool
{
...
...
Please
register
or
login
to post a comment