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 15:36:32 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
019526a3eb7406d880eb7e8656de24118ca73db1
019526a3
1 parent
2750e1ac
add flashlight delegate to barcode reader base
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
lib/src/web/barcode_reader.dart
lib/src/web/flashlight_delegate.dart
lib/src/web/barcode_reader.dart
View file @
019526a
...
...
@@ -7,12 +7,16 @@ import 'package:mobile_scanner/src/enums/mobile_scanner_error_code.dart';
import
'package:mobile_scanner/src/mobile_scanner_exception.dart'
;
import
'package:mobile_scanner/src/objects/barcode_capture.dart'
;
import
'package:mobile_scanner/src/objects/start_options.dart'
;
import
'package:mobile_scanner/src/web/flashlight_delegate.dart'
;
import
'package:web/web.dart'
;
/// This class represents the base interface for a barcode reader implementation.
abstract
class
BarcodeReader
{
const
BarcodeReader
();
/// Get the flashlight delegate for the barcode reader.
FlashlightDelegate
get
flashlightDelegate
=>
const
FlashlightDelegate
();
/// Whether the scanner is currently scanning for barcodes.
bool
get
isScanning
{
throw
UnimplementedError
(
'isScanning has not been implemented.'
);
...
...
lib/src/web/flashlight_delegate.dart
View file @
019526a
...
...
@@ -7,6 +7,9 @@ import 'package:web/web.dart';
///
/// It provides an interface to query and update the flashlight state of a [MediaStream].
final
class
FlashlightDelegate
{
/// Constructs a [FlashlightDelegate] instance.
const
FlashlightDelegate
();
/// Returns a list of supported flashlight modes for the given [mediaStream].
///
/// The [TorchState.off] mode is always supported, regardless of the return value.
...
...
Please
register
or
login
to post a comment