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-01-29 11:06:37 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
85c7bd38428b89df7455a7ec983d443b21c665e3
85c7bd38
1 parent
6497f4df
skip call to stop if not initialized or disposed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
lib/src/mobile_scanner_controller.dart
lib/src/mobile_scanner_controller.dart
View file @
85c7bd3
...
...
@@ -297,10 +297,11 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
///
/// Does nothing if the camera is already stopped.
Future
<
void
>
stop
()
async
{
_throwIfNotInitialized
();
// Do nothing if already stopped.
if
(!
value
.
isRunning
)
{
// Do nothing if not initialized or already stopped.
// On the web, the permission popup triggers a lifecycle change from resumed to inactive,
// due to the permission popup gaining focus.
// This would 'stop' the camera while it is not ready yet.
if
(!
value
.
isInitialized
||
!
value
.
isRunning
||
_isDisposed
)
{
return
;
}
...
...
Please
register
or
login
to post a comment