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
p-mazhnik
2022-11-22 16:17:03 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0e0ce5b55ee2a79a5c0be031213bf9fa71cc1bb5
0e0ce5b5
1 parent
6c76a7f0
flutter format
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
lib/mobile_scanner_web_plugin.dart
lib/src/mobile_scanner_controller.dart
lib/src/web/base.dart
lib/src/web/jsqr.dart
lib/src/web/zxing.dart
lib/mobile_scanner_web_plugin.dart
View file @
0e0ce5b
...
...
@@ -94,7 +94,8 @@ class MobileScannerWebPlugin {
cameraFacing:
cameraFacing
,
);
_barCodeStreamSubscription
=
barCodeReader
.
detectBarcodeContinuously
().
listen
((
code
)
{
_barCodeStreamSubscription
=
barCodeReader
.
detectBarcodeContinuously
().
listen
((
code
)
{
if
(
code
!=
null
)
{
controller
.
add
({
'name'
:
'barcodeWeb'
,
...
...
lib/src/mobile_scanner_controller.dart
View file @
0e0ce5b
import
'dart:async'
;
import
'dart:io'
;
import
'dart:typed_data'
;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
...
...
lib/src/web/base.dart
View file @
0e0ce5b
...
...
@@ -119,4 +119,3 @@ mixin InternalTorchDetection on InternalStreamCreation {
}
}
}
...
...
lib/src/web/jsqr.dart
View file @
0e0ce5b
...
...
@@ -20,7 +20,6 @@ class Code {
external
Uint8ClampedList
get
binaryData
;
}
class
JsQrCodeReader
extends
WebBarcodeReaderBase
with
InternalStreamCreation
,
InternalTorchDetection
{
JsQrCodeReader
({
required
super
.
videoContainer
});
...
...
@@ -78,7 +77,8 @@ class JsQrCodeReader extends WebBarcodeReaderBase
/// Captures a frame and analyzes it for QR codes
Future
<
Code
?>
_captureFrame
(
VideoElement
video
)
async
{
if
(
localMediaStream
==
null
)
return
null
;
final
canvas
=
CanvasElement
(
width:
video
.
videoWidth
,
height:
video
.
videoHeight
);
final
canvas
=
CanvasElement
(
width:
video
.
videoWidth
,
height:
video
.
videoHeight
);
final
ctx
=
canvas
.
context2D
;
ctx
.
drawImage
(
video
,
0
,
0
);
...
...
lib/src/web/zxing.dart
View file @
0e0ce5b
...
...
@@ -26,8 +26,10 @@ class JsZXingBrowserMultiFormatReader {
abstract
class
Result
{
/// raw text encoded by the barcode
external
String
get
text
;
/// Returns raw bytes encoded by the barcode, if applicable, otherwise null
external
Uint8ClampedList
?
get
rawBytes
;
/// Representing the format of the barcode that was decoded
external
int
?
format
;
}
...
...
@@ -87,7 +89,10 @@ abstract class Exception {
external
String
get
message
;
}
typedef
BarcodeDetectionCallback
=
void
Function
(
Result
?
result
,
Exception
?
error
);
typedef
BarcodeDetectionCallback
=
void
Function
(
Result
?
result
,
Exception
?
error
,
);
extension
JsZXingBrowserMultiFormatReaderExt
on
JsZXingBrowserMultiFormatReader
{
...
...
Please
register
or
login
to post a comment