setTrigger method

  1. @override
Future<void> setTrigger({
  1. required Triggering triggering,
})
override

Sets the triggering mode for the scanner.

The triggering parameter is a Triggering enum value that specifies the desired triggering mode.

Triggering.CONTINUOUS scanning mode allows a scanner (such as a barcode scanner) to operate continuously without the need for a trigger button or user intervention. The scanner will automatically scan and read barcodes when it encounters them within its scanning range without being activated by the user. This mode is suitable when you want to scan multiple barcodes continuously without having to press the scan button each time.

Triggering.HOST Host mode, also known as on-demand trigger mode, requires the user to press the scan button (trigger) on the scanner when they want to scan a specific barcode. The scanner does not scan automatically and requires user intervention to activate the scanning process. This mode is often used when you want precise control over when to scan barcodes and to avoid unnecessary scans.

Triggering.PULSE Pulse mode is a combination of continuous scanning mode and trigger mode. In this mode, the scanner scans continuously, but it only reads barcodes when the user presses the scan button (trigger) once. After the user activates the trigger, the scanner scans and reads barcodes within its range. Pulse mode allows users to control the timing of barcode scanning while still benefiting from continuous scanning when barcodes are within the scanner's range.

Implementation

@override
Future<void> setTrigger({required Triggering triggering}) async {
  await methodChannel.invokeMethod(
      'setTrigger', triggeringValues[triggering]);
}