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-12-07 08:31:40 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c11832e50b9a8507d6452cf4b2a5039193ed8b9d
c11832e5
1 parent
8be461cd
add a toBarcode getter to the rsult JS interop class
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
lib/src/web/zxing/result.dart
lib/src/web/zxing/result.dart
View file @
c11832e
...
...
@@ -3,6 +3,8 @@ import 'dart:typed_data';
import
'dart:ui'
;
import
'package:mobile_scanner/src/enums/barcode_format.dart'
;
import
'package:mobile_scanner/src/enums/barcode_type.dart'
;
import
'package:mobile_scanner/src/objects/barcode.dart'
;
import
'package:mobile_scanner/src/web/zxing/result_point.dart'
;
/// The JS static interop class for the Result class in the ZXing library.
...
...
@@ -109,4 +111,16 @@ extension ResultExt on Result {
return
timestamp
?.
toDartInt
;
}
/// Convert this result to a [Barcode].
Barcode
get
toBarcode
{
return
Barcode
(
corners:
resultPoints
,
format:
barcodeFormat
,
displayValue:
text
,
rawBytes:
rawBytes
,
rawValue:
text
,
type:
BarcodeType
.
text
,
);
}
}
...
...
Please
register
or
login
to post a comment