set interval for QR coder scanner in flutter
This code will check if the last scan was performed less than the specified duration, if the duration exceeds it will print the data
DateTime? lastScan;..._qRViewController?.scannedDataStream.listen((data) { final currentScan = DateTime.now(); if (lastScan == null || currentScan.difference(lastScan!) > const Duration(seconds: 1)) { lastScan = currentScan; print(data.code); }});