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-09 16:37:31 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
320e648c5af8fff89a70165d3de8239eb137a711
320e648c
1 parent
cd6d5bd4
do not dispose global controller on web
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
lib/src/web/mobile_scanner_web.dart
lib/src/web/mobile_scanner_web.dart
View file @
320e648
...
...
@@ -353,10 +353,6 @@ class MobileScannerWeb extends MobileScannerPlatform {
@override
Future
<
void
>
stop
()
async
{
if
(
_barcodesController
.
isClosed
)
{
return
;
}
// Ensure the barcode scanner is stopped, by cancelling the subscription.
await
_barcodesSubscription
?.
cancel
();
_barcodesSubscription
=
null
;
...
...
@@ -374,12 +370,8 @@ class MobileScannerWeb extends MobileScannerPlatform {
@override
Future
<
void
>
dispose
()
async
{
if
(
_barcodesController
.
isClosed
)
{
return
;
}
// The `_barcodesController` and `_settingsController`
// are not closed, as these have the same lifetime as the plugin.
await
stop
();
await
_barcodesController
.
close
();
await
_settingsController
.
close
();
}
}
...
...
Please
register
or
login
to post a comment