Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2024-04-29 11:03:31 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c3a0f8665a11695bb20b8611e0904b1dd3d6b41b
c3a0f866
1 parent
536c4ac8
report unavailable instead of off when stopping the camera if there was no torch
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
c3a0f86
...
...
@@ -313,11 +313,16 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
_disposeListeners
();
final
TorchState
oldTorchState
=
value
.
torchState
;
// After the camera stopped, set the torch state to off,
// as the torch state callback is never called when the camera is stopped.
// If the device does not have a torch, do not report "off".
value
=
value
.
copyWith
(
isRunning:
false
,
torchState:
TorchState
.
off
,
torchState:
oldTorchState
==
TorchState
.
unavailable
?
TorchState
.
unavailable
:
TorchState
.
off
,
);
await
MobileScannerPlatform
.
instance
.
stop
();
...
...
Please
register
or
login
to post a comment