Showing
3 changed files
with
3 additions
and
3 deletions
| @@ -71,7 +71,7 @@ class _BarcodeScannerWithControllerState | @@ -71,7 +71,7 @@ class _BarcodeScannerWithControllerState | ||
| 71 | case AppLifecycleState.paused: | 71 | case AppLifecycleState.paused: |
| 72 | return; | 72 | return; |
| 73 | case AppLifecycleState.resumed: | 73 | case AppLifecycleState.resumed: |
| 74 | - _subscription ??= controller.barcodes.listen(_handleBarcode); | 74 | + _subscription = controller.barcodes.listen(_handleBarcode); |
| 75 | 75 | ||
| 76 | unawaited(controller.start()); | 76 | unawaited(controller.start()); |
| 77 | case AppLifecycleState.inactive: | 77 | case AppLifecycleState.inactive: |
| @@ -90,7 +90,7 @@ class _BarcodeScannerWithScanWindowState | @@ -90,7 +90,7 @@ class _BarcodeScannerWithScanWindowState | ||
| 90 | @override | 90 | @override |
| 91 | Widget build(BuildContext context) { | 91 | Widget build(BuildContext context) { |
| 92 | final scanWindow = Rect.fromCenter( | 92 | final scanWindow = Rect.fromCenter( |
| 93 | - center: MediaQuery.of(context).size.center(Offset.zero), | 93 | + center: MediaQuery.sizeOf(context).center(Offset.zero), |
| 94 | width: 200, | 94 | width: 200, |
| 95 | height: 200, | 95 | height: 200, |
| 96 | ); | 96 | ); |
| @@ -23,7 +23,7 @@ class _BarcodeScannerWithOverlayState extends State<BarcodeScannerWithOverlay> { | @@ -23,7 +23,7 @@ class _BarcodeScannerWithOverlayState extends State<BarcodeScannerWithOverlay> { | ||
| 23 | @override | 23 | @override |
| 24 | Widget build(BuildContext context) { | 24 | Widget build(BuildContext context) { |
| 25 | final scanWindow = Rect.fromCenter( | 25 | final scanWindow = Rect.fromCenter( |
| 26 | - center: MediaQuery.of(context).size.center(Offset.zero), | 26 | + center: MediaQuery.sizeOf(context).center(Offset.zero), |
| 27 | width: 200, | 27 | width: 200, |
| 28 | height: 200, | 28 | height: 200, |
| 29 | ); | 29 | ); |
-
Please register or login to post a comment