startScanner method

  1. @override
Future<bool?> startScanner({
  1. bool turnOnFlash = false,
  2. bool turnOnBeep = false,
  3. bool turnOnVibration = false,
  4. ScannerMode scannerMode = ScannerMode.single,
  5. int delay = 500,
})
override

Implementation

@override
Future<bool?> startScanner({
  bool turnOnFlash = false,
  bool turnOnBeep = false,
  bool turnOnVibration = false,
  ScannerMode scannerMode = ScannerMode.single,
  int delay = 500,
}) async {
  try {
    return await scanningMethodChannel.invokeMethod<bool>('startScanner', {
      "turnOnFlash": turnOnFlash,
      "turnOnBeep": turnOnBeep,
      "turnOnVibration": turnOnVibration,
      "scannerMode": scannerMode.value,
      "delay": delay,
    });
  } catch (_) {
    return null;
  }
}