MethodChannelHardwareBarcodeScanner constructor

MethodChannelHardwareBarcodeScanner({
  1. @visibleForTesting bool? isWeb,
})

Creates the default platform implementation.

HardwareBarcodeScannerPlatform.instance already holds one of these, so applications rarely need to construct it themselves.

isWeb exists only so tests can exercise the web path; kIsWeb is a compile-time constant that a VM test can never make true.

Implementation

MethodChannelHardwareBarcodeScanner({@visibleForTesting bool? isWeb})
    : _isWeb = isWeb ?? kIsWeb;