KeyboardWedgeSource constructor

KeyboardWedgeSource({
  1. WedgeConfig config = const WedgeConfig(),
  2. bool ignoreWhenEditing = true,
  3. bool useEventTimestamps = true,
  4. ScanSymbology symbology = ScanSymbology.unknown,
  5. Duration clock()?,
  6. DateTime wallClock()?,
})

Creates a source. Call start (or use KeyboardWedgeListener).

clock returns monotonic time; by default a Stopwatch. With useEventTimestamps, the key events' own timestamps are used when the platform provides them, so a busy UI thread does not split a scan.

Implementation

KeyboardWedgeSource({
  WedgeConfig config = const WedgeConfig(),
  this.ignoreWhenEditing = true,
  this.useEventTimestamps = true,
  this.symbology = ScanSymbology.unknown,
  Duration Function()? clock,
  DateTime Function()? wallClock,
}) : _assembler = WedgeAssembler(config),
     _clock = clock ?? _stopwatchClock(),
     _wallClock = wallClock ?? DateTime.now;