diff --git a/assets/release_notes.md b/assets/release_notes.md index 8d3947bf..93c8ad84 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -2,6 +2,8 @@ --- - Improved barcode scanning with new scanning library +- Prevent screen turning off when scanning barcodes +- Improved support for Stock Item test results - Enhanced home-screen display using grid-view - Improvements for image uploading - Provide "upload image" shortcut on Purchase Order detail view diff --git a/lib/barcode/camera_controller.dart b/lib/barcode/camera_controller.dart index ea4cf633..2e40ef48 100644 --- a/lib/barcode/camera_controller.dart +++ b/lib/barcode/camera_controller.dart @@ -3,7 +3,7 @@ import "package:flutter/material.dart"; import "package:flutter_tabler_icons/flutter_tabler_icons.dart"; import "package:inventree/app_colors.dart"; import "package:inventree/preferences.dart"; - +import "package:wakelock_plus/wakelock_plus.dart"; import "package:flutter_zxing/flutter_zxing.dart"; import "package:inventree/l10.dart"; @@ -38,6 +38,13 @@ class _CameraBarcodeControllerState extends InvenTreeBarcodeControllerState { void initState() { super.initState(); _loadSettings(); + WakelockPlus.enable(); + } + + @override + void dispose() { + super.dispose(); + WakelockPlus.disable(); } /* diff --git a/pubspec.lock b/pubspec.lock index afda72c6..2a5876ec 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -286,6 +286,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.1" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" device_info_plus: dependency: "direct main" description: @@ -1207,6 +1215,22 @@ packages: url: "https://pub.dev" source: hosted version: "14.2.5" + wakelock_plus: + dependency: "direct main" + description: + name: wakelock_plus + sha256: bf4ee6f17a2fa373ed3753ad0e602b7603f8c75af006d5b9bdade263928c0484 + url: "https://pub.dev" + source: hosted + version: "1.2.8" + wakelock_plus_platform_interface: + dependency: transitive + description: + name: wakelock_plus_platform_interface + sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16" + url: "https://pub.dev" + source: hosted + version: "1.2.1" watcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 496fd1c5..2bcb6ac9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -40,6 +40,7 @@ dependencies: sembast: ^3.6.0 # NoSQL data storage sentry_flutter: 8.9.0 # Error reporting url_launcher: ^6.3.0 # Open link in system browser + wakelock_plus: ^1.2.8 # Prevent device from sleeping dev_dependencies: flutter_launcher_icons: ^0.14.1