Navaron Bracke

add flashlight delegate to barcode reader base

... ... @@ -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.');
... ...
... ... @@ -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.
... ...