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
Julian Steenbakker
2024-05-02 15:10:08 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
15522ea1ad0f2fb2c05af121234fbbc8a3d91aa4
15522ea1
1 parent
695530ae
imp: fix typo, make subscription private
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
lib/src/mobile_scanner.dart
lib/src/mobile_scanner.dart
View file @
15522ea
...
...
@@ -34,7 +34,7 @@ class MobileScanner extends StatefulWidget {
final
MobileScannerController
?
controller
;
/// The function that signals when new codes were detected by the [controller].
/// If null, use the contrller.barcodes stream directly to capture barcodes.
/// If null, use the contr
o
ller.barcodes stream directly to capture barcodes.
final
void
Function
(
BarcodeCapture
barcodes
)?
onDetect
;
/// The error builder for the camera preview.
...
...
@@ -242,12 +242,12 @@ class _MobileScannerState extends State<MobileScanner> {
);
}
StreamSubscription
?
barcodeSubscription
;
StreamSubscription
?
_
barcodeSubscription
;
@override
void
initState
()
{
if
(
widget
.
onDetect
!=
null
)
{
barcodeSubscription
=
controller
.
barcodes
.
listen
(
widget
.
onDetect
);
_
barcodeSubscription
=
controller
.
barcodes
.
listen
(
widget
.
onDetect
);
}
if
(
controller
.
autoStart
)
{
controller
.
start
();
...
...
@@ -258,9 +258,9 @@ class _MobileScannerState extends State<MobileScanner> {
@override
void
dispose
()
{
super
.
dispose
();
if
(
barcodeSubscription
!=
null
)
{
barcodeSubscription
!.
cancel
();
barcodeSubscription
=
null
;
if
(
_barcodeSubscription
!=
null
)
{
_barcodeSubscription
!.
cancel
();
_barcodeSubscription
=
null
;
}
if
(
controller
.
autoStart
)
{
...
...
Please
register
or
login
to post a comment