Skip to content

Commit

Permalink
Screen wake (#565)
Browse files Browse the repository at this point in the history
* Prevent screen turning off when scanning barcodes

- Close #492

* Update release notes
  • Loading branch information
SchrodingersGat authored Dec 6, 2024
1 parent 6f5fc1d commit 707d251
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion lib/barcode/camera_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -38,6 +38,13 @@ class _CameraBarcodeControllerState extends InvenTreeBarcodeControllerState {
void initState() {
super.initState();
_loadSettings();
WakelockPlus.enable();
}

@override
void dispose() {
super.dispose();
WakelockPlus.disable();
}

/*
Expand Down
24 changes: 24 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 707d251

Please sign in to comment.