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 13:59:16 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fd67b8b78be19821476a068ea32483973d8c7a86
fd67b8b7
1 parent
982f6ddf
update some doc comments on iOS
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
ios/Classes/MobileScannerPlugin.swift
ios/Classes/MobileScannerPlugin.swift
View file @
fd67b8b
...
...
@@ -95,7 +95,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
}
}
///
Parses all parameters and starts the mobileScanner
///
Start the mobileScanner.
private
func
start
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
torch
:
Bool
=
(
call
.
arguments
as!
Dictionary
<
String
,
Any
?
>
)[
"torch"
]
as?
Bool
??
false
let
facing
:
Int
=
(
call
.
arguments
as!
Dictionary
<
String
,
Any
?
>
)[
"facing"
]
as?
Int
??
1
...
...
@@ -151,7 +151,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
}
}
/// Stops the mobileScanner and closes the texture
/// Stops the mobileScanner and closes the texture
.
private
func
stop
(
_
result
:
@escaping
FlutterResult
)
{
do
{
try
mobileScanner
.
stop
()
...
...
@@ -159,7 +159,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
result
(
nil
)
}
/// Toggles the torch
/// Toggles the torch
.
private
func
toggleTorch
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
do
{
try
mobileScanner
.
toggleTorch
(
call
.
arguments
as?
Int
==
1
?
.
on
:
.
off
)
...
...
@@ -171,7 +171,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
}
}
///
Toggles the zoomScale
///
Sets the zoomScale.
private
func
setScale
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
scale
=
call
.
arguments
as?
CGFloat
if
(
scale
==
nil
)
{
...
...
@@ -198,7 +198,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
}
}
/// Reset the zoomScale
/// Reset the zoomScale
.
private
func
resetScale
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
do
{
try
mobileScanner
.
resetScale
()
...
...
@@ -218,7 +218,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
}
}
///
Toggles the torch
///
Updates the scan window rectangle.
func
updateScanWindow
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
scanWindowData
:
Array
?
=
(
call
.
arguments
as?
[
String
:
Any
])?[
"rect"
]
as?
[
CGFloat
]
MobileScannerPlugin
.
scanWindow
=
scanWindowData
...
...
@@ -240,7 +240,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin {
return
CGRect
(
x
:
minX
,
y
:
minY
,
width
:
width
,
height
:
height
)
}
/// Analyzes a single image
/// Analyzes a single image
.
private
func
analyzeImage
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
uiImage
=
UIImage
(
contentsOfFile
:
call
.
arguments
as?
String
??
""
)
...
...
Please
register
or
login
to post a comment