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-24 18:00:18 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3d95c0514df6217565e1c4c829071b429d5fff4b
3d95c051
1 parent
2ffea90b
move the dispatch queue switch for the start completion block for readability
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
ios/Classes/MobileScanner.swift
ios/Classes/MobileScannerPlugin.swift
ios/Classes/MobileScanner.swift
View file @
3d95c05
...
...
@@ -232,7 +232,6 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
device
.
activeFormat
.
formatDescription
)
let
hasTorch
=
device
.
hasTorch
DispatchQueue
.
main
.
async
{
completion
(
MobileScannerStartParameters
(
width
:
Double
(
dimensions
.
height
),
...
...
@@ -241,16 +240,13 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
textureId
:
self
.
textureId
??
0
)
)
}
return
}
DispatchQueue
.
main
.
async
{
completion
(
MobileScannerStartParameters
())
}
}
}
/// Stop scanning for barcodes
func
stop
()
throws
{
...
...
ios/Classes/MobileScannerPlugin.swift
View file @
3d95c05
...
...
@@ -121,7 +121,12 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
do
{
try
mobileScanner
.
start
(
barcodeScannerOptions
:
barcodeOptions
,
returnImage
:
returnImage
,
cameraPosition
:
position
,
torch
:
torch
?
.
on
:
.
off
,
detectionSpeed
:
detectionSpeed
)
{
parameters
in
result
([
"textureId"
:
parameters
.
textureId
,
"size"
:
[
"width"
:
parameters
.
width
,
"height"
:
parameters
.
height
],
"torchable"
:
parameters
.
hasTorch
])
DispatchQueue
.
main
.
async
{
result
([
"textureId"
:
parameters
.
textureId
,
"size"
:
[
"width"
:
parameters
.
width
,
"height"
:
parameters
.
height
],
"torchable"
:
parameters
.
hasTorch
])
}
}
}
catch
MobileScannerError
.
alreadyStarted
{
result
(
FlutterError
(
code
:
"MobileScanner"
,
...
...
Please
register
or
login
to post a comment