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-27 17:29:55 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4756a6d33e94c1df7b206859745ec2b5f72b7391
4756a6d3
1 parent
1c9e0f5b
update the zxing JS interop definition
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
lib/src/web/zxing/zxing_browser_multi_format_reader.dart
lib/src/web/zxing/zxing_browser_multi_format_reader.dart
0 → 100644
View file @
4756a6d
import
'dart:js_interop'
;
import
'package:js/js.dart'
;
import
'package:web/web.dart'
;
/// The JS interop class for the ZXing BrowserMultiFormatReader.
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserMultiFormatReader.ts
@JS
(
'ZXing.BrowserMultiFormatReader'
)
@staticInterop
class
ZXingBrowserMultiFormatReader
{
/// Construct a new ZXingBrowserMultiFormatReader.
///
/// The [hints] are the configuration options for the reader.
/// The [timeBetweenScansMillis] is the allowed time between scans in milliseconds.
///
/// See also: https://github.com/zxing-js/library/blob/master/src/core/DecodeHintType.ts
external
factory
ZXingBrowserMultiFormatReader
(
JSAny
?
hints
,
int
?
timeBetweenScansMillis
,
);
}
extension
ZXingBrowserMultiFormatReaderExt
on
ZXingBrowserMultiFormatReader
{
/// Set the source for the [HTMLVideoElement] that acts as input for the barcode reader.
///
/// This function takes a [HTMLVideoElement], and a [MediaStream] as arguments,
/// and returns no result.
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserCodeReader.ts#L1182
external
JSFunction
addVideoSource
;
/// Continuously decode barcodes from a [HTMLVideoElement].
///
/// When a barcode is found, a callback function is called with the result.
/// The callback function receives a [Result] and an exception object as arguments.
///
/// See also: https://github.com/zxing-js/library/blob/master/src/browser/DecodeContinuouslyCallback.ts
external
JSFunction
decodeContinuously
;
/// Whether the video stream is currently playing.
///
/// This function takes a [HTMLVideoElement] as argument,
/// and returns a [bool].
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserCodeReader.ts#L458
external
JSFunction
isVideoPlaying
;
/// Prepare the video element for the barcode reader.
///
/// This function takes a [HTMLVideoElement] as argument,
/// and returns the same [HTMLVideoElement],
/// after it was prepared for the barcode reader.
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserCodeReader.ts#L802
external
JSFunction
prepareVideoElement
;
/// Reset the barcode reader to it's initial state,
/// and stop any ongoing barcode decoding.
///
/// This function takes no arguments and returns no result.
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserCodeReader.ts#L1104
external
JSFunction
reset
;
/// Stop decoding barcodes.
///
/// This function takes no arguments and returns no result.
///
/// See https://github.com/zxing-js/library/blob/master/src/browser/BrowserCodeReader.ts#L396
external
JSFunction
stopContinuousDecode
;
}
...
...
Please
register
or
login
to post a comment