Julian Steenbakker

imp: fix typo, make subscription private

@@ -34,7 +34,7 @@ class MobileScanner extends StatefulWidget { @@ -34,7 +34,7 @@ class MobileScanner extends StatefulWidget {
34 final MobileScannerController? controller; 34 final MobileScannerController? controller;
35 35
36 /// The function that signals when new codes were detected by the [controller]. 36 /// The function that signals when new codes were detected by the [controller].
37 - /// If null, use the contrller.barcodes stream directly to capture barcodes. 37 + /// If null, use the controller.barcodes stream directly to capture barcodes.
38 final void Function(BarcodeCapture barcodes)? onDetect; 38 final void Function(BarcodeCapture barcodes)? onDetect;
39 39
40 /// The error builder for the camera preview. 40 /// The error builder for the camera preview.
@@ -242,12 +242,12 @@ class _MobileScannerState extends State<MobileScanner> { @@ -242,12 +242,12 @@ class _MobileScannerState extends State<MobileScanner> {
242 ); 242 );
243 } 243 }
244 244
245 - StreamSubscription? barcodeSubscription; 245 + StreamSubscription? _barcodeSubscription;
246 246
247 @override 247 @override
248 void initState() { 248 void initState() {
249 if (widget.onDetect != null) { 249 if (widget.onDetect != null) {
250 - barcodeSubscription = controller.barcodes.listen(widget.onDetect); 250 + _barcodeSubscription = controller.barcodes.listen(widget.onDetect);
251 } 251 }
252 if (controller.autoStart) { 252 if (controller.autoStart) {
253 controller.start(); 253 controller.start();
@@ -258,9 +258,9 @@ class _MobileScannerState extends State<MobileScanner> { @@ -258,9 +258,9 @@ class _MobileScannerState extends State<MobileScanner> {
258 @override 258 @override
259 void dispose() { 259 void dispose() {
260 super.dispose(); 260 super.dispose();
261 - if (barcodeSubscription != null) {  
262 - barcodeSubscription!.cancel();  
263 - barcodeSubscription = null; 261 + if (_barcodeSubscription != null) {
  262 + _barcodeSubscription!.cancel();
  263 + _barcodeSubscription = null;
264 } 264 }
265 265
266 if (controller.autoStart) { 266 if (controller.autoStart) {