mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-14 11:15:26 +00:00
.github
android
assets
ios
lib
barcode
barcode.dart
camera_controller.dart
controller.dart
handler.dart
purchase_order.dart
sales_order.dart
stock.dart
tones.dart
wedge_controller.dart
generated
inventree
l10n
settings
widget
api.dart
api_form.dart
app_colors.dart
dsn.dart
helpers.dart
l10.dart
labels.dart
main.dart
preferences.dart
user_profile.dart
res
test
.gitignore
.gitmodules
.metadata
BUILDING.md
LICENSE
README.md
analysis_options.yaml
crowdin.yml
find_dart_files.py
l10n.yaml
pubspec.lock
pubspec.yaml
requirements.txt
tasks.py
* Move barcode.dart * Fix * Refactoring barcode scanner code: - Abstract the "controller" class (for future development) - Break barcode scanning code out into multiple files - Add CameraBarcodeController class (qr_code_scanner) * Add await * Make barcode scan delay configurable * remove unused import * Handle camera exceptions * Improve sequencing for camera scanner - Show loading overlay - Prevent reload if view is no longer mounted * Update docstring * Update release notes
23 lines
550 B
Dart
23 lines
550 B
Dart
import "package:inventree/helpers.dart";
|
|
import "package:inventree/preferences.dart";
|
|
|
|
/*
|
|
* Play an audible 'success' alert to the user.
|
|
*/
|
|
Future<void> barcodeSuccessTone() async {
|
|
|
|
final bool en = await InvenTreeSettingsManager().getValue(INV_SOUNDS_BARCODE, true) as bool;
|
|
|
|
if (en) {
|
|
playAudioFile("sounds/barcode_scan.mp3");
|
|
}
|
|
}
|
|
|
|
Future <void> barcodeFailureTone() async {
|
|
|
|
final bool en = await InvenTreeSettingsManager().getValue(INV_SOUNDS_BARCODE, true) as bool;
|
|
|
|
if (en) {
|
|
playAudioFile("sounds/barcode_error.mp3");
|
|
}
|
|
} |