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
Jørgen P. Tjernø
2022-08-26 20:18:04 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
89aa7d1f1e8d2989636425deacbe991469dcee72
89aa7d1f
1 parent
de01170d
Add support for multiple formats on iOS
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
ios/Classes/SwiftMobileScannerPlugin.swift
lib/src/mobile_scanner_controller.dart
ios/Classes/SwiftMobileScannerPlugin.swift
View file @
89aa7d1
...
...
@@ -195,13 +195,13 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHan
let
facing
:
Int
=
argReader
.
int
(
key
:
"facing"
)
??
1
let
formats
:
Array
=
argReader
.
intArray
(
key
:
"formats"
)
??
[]
let
formatList
:
NSMutableArray
=
[]
if
(
formats
.
count
!=
0
)
{
var
barcodeFormats
:
BarcodeFormat
=
[]
for
index
in
formats
{
formatList
.
add
(
BarcodeFormat
(
rawValue
:
index
))
barcodeFormats
.
insert
(
BarcodeFormat
(
rawValue
:
index
))
}
if
(
formatList
.
count
!=
0
)
{
let
barcodeOptions
=
BarcodeScannerOptions
(
formats
:
formatList
.
firstObject
as!
BarcodeFormat
)
let
barcodeOptions
=
BarcodeScannerOptions
(
formats
:
barcodeFormats
)
scanner
=
BarcodeScanner
.
barcodeScanner
(
options
:
barcodeOptions
)
}
...
...
lib/src/mobile_scanner_controller.dart
View file @
89aa7d1
...
...
@@ -49,8 +49,6 @@ class MobileScannerController {
final
bool
returnImage
;
/// If provided, the scanner will only detect those specific formats.
///
/// WARNING: On iOS, only 1 format is supported.
final
List
<
BarcodeFormat
>?
formats
;
CameraFacing
facing
;
...
...
Please
register
or
login
to post a comment