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-22 17:01:35 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
caaaca7891ec8e0e6c3faf451c7b1bb4ad56238e
caaaca78
1 parent
eca23318
format SwiftMobileScannerPlugin.swift
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
ios/Classes/SwiftMobileScannerPlugin.swift
ios/Classes/SwiftMobileScannerPlugin.swift
View file @
caaaca7
...
...
@@ -24,7 +24,6 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin {
let
barcodeheight
=
barcode
.
cornerPoints
!
[
3
]
.
cgPointValue
.
y
-
barcodeminY
let
barcodeBox
=
CGRect
(
x
:
barcodeminX
,
y
:
barcodeminY
,
width
:
barcodewidth
,
height
:
barcodeheight
)
let
minX
=
scanwindow
[
0
]
*
imageSize
.
width
let
minY
=
scanwindow
[
1
]
*
imageSize
.
height
...
...
@@ -66,10 +65,9 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin {
}
public
static
func
register
(
with
registrar
:
FlutterPluginRegistrar
)
{
let
channel
=
FlutterMethodChannel
(
name
:
"dev.steenbakker.mobile_scanner/scanner/method"
,
binaryMessenger
:
registrar
.
messenger
())
let
instance
=
SwiftMobileScannerPlugin
(
barcodeHandler
:
BarcodeHandler
(
registrar
:
registrar
),
registry
:
registrar
.
textures
())
let
methodChannel
=
FlutterMethodChannel
(
name
:
"dev.steenbakker.mobile_scanner/scanner/method"
,
binaryMessenger
:
registrar
.
messenger
())
registrar
.
addMethodCallDelegate
(
instance
,
channel
:
methodChannel
)
registrar
.
addMethodCallDelegate
(
instance
,
channel
:
channel
)
}
public
func
handle
(
_
call
:
FlutterMethodCall
,
result
:
@escaping
FlutterResult
)
{
...
...
@@ -118,7 +116,6 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin {
barcodeOptions
=
BarcodeScannerOptions
(
formats
:
barcodeFormats
)
}
let
position
=
facing
==
0
?
AVCaptureDevice
.
Position
.
front
:
.
back
let
detectionSpeed
:
DetectionSpeed
=
DetectionSpeed
(
rawValue
:
speed
)
!
...
...
@@ -216,7 +213,6 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin {
result
(
nil
)
}
/// Toggles the torch
func
updateScanWindow
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
scanWindowData
:
Array
?
=
(
call
.
arguments
as?
[
String
:
Any
])?[
"rect"
]
as?
[
CGFloat
]
...
...
Please
register
or
login
to post a comment