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-11-22 12:27:50 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
167b83887920456c0f6e9de13dbcbab76dc0d7d4
167b8388
1 parent
60d93c70
add stub for ZXing barcode reader
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
lib/src/web/zxing/zxing_barcode_reader.dart
lib/src/web/zxing/zxing_barcode_reader.dart
0 → 100644
View file @
167b838
import
'package:mobile_scanner/src/enums/barcode_format.dart'
;
import
'package:mobile_scanner/src/web/barcode_reader.dart'
;
import
'package:mobile_scanner/src/web/zxing/zxing_browser_multi_format_reader.dart'
;
/// A barcode reader implementation that uses the ZXing library.
final
class
ZXingBarcodeReader
extends
BarcodeReader
{
ZXingBarcodeReader
();
/// The internal barcode reader.
ZXingBrowserMultiFormatReader
?
_reader
;
@override
String
get
scriptUrl
=>
'https://unpkg.com/@zxing/library@0.19.1'
;
/// Get the barcode format from the ZXing library, for the given [format].
int
getZXingBarcodeFormat
(
BarcodeFormat
format
)
{
switch
(
format
)
{
case
BarcodeFormat
.
aztec
:
return
0
;
case
BarcodeFormat
.
codabar
:
return
1
;
case
BarcodeFormat
.
code39
:
return
2
;
case
BarcodeFormat
.
code93
:
return
3
;
case
BarcodeFormat
.
code128
:
return
4
;
case
BarcodeFormat
.
dataMatrix
:
return
5
;
case
BarcodeFormat
.
ean8
:
return
6
;
case
BarcodeFormat
.
ean13
:
return
7
;
case
BarcodeFormat
.
itf
:
return
8
;
case
BarcodeFormat
.
pdf417
:
return
10
;
case
BarcodeFormat
.
qrCode
:
return
11
;
case
BarcodeFormat
.
upcA
:
return
14
;
case
BarcodeFormat
.
upcE
:
return
15
;
case
BarcodeFormat
.
unknown
:
case
BarcodeFormat
.
all
:
return
-
1
;
}
}
}
...
...
Please
register
or
login
to post a comment