p-mazhnik

flutter format

@@ -73,7 +73,7 @@ class MobileScannerWebPlugin { @@ -73,7 +73,7 @@ class MobileScannerWebPlugin {
73 // ignore: UNDEFINED_PREFIXED_NAME, avoid_dynamic_calls 73 // ignore: UNDEFINED_PREFIXED_NAME, avoid_dynamic_calls
74 ui.platformViewRegistry.registerViewFactory( 74 ui.platformViewRegistry.registerViewFactory(
75 viewID, 75 viewID,
76 - (int id) { 76 + (int id) {
77 return vidDiv 77 return vidDiv
78 ..style.width = '100%' 78 ..style.width = '100%'
79 ..style.height = '100%'; 79 ..style.height = '100%';
@@ -94,7 +94,8 @@ class MobileScannerWebPlugin { @@ -94,7 +94,8 @@ class MobileScannerWebPlugin {
94 cameraFacing: cameraFacing, 94 cameraFacing: cameraFacing,
95 ); 95 );
96 96
97 - _barCodeStreamSubscription = barCodeReader.detectBarcodeContinuously().listen((code) { 97 + _barCodeStreamSubscription =
  98 + barCodeReader.detectBarcodeContinuously().listen((code) {
98 if (code != null) { 99 if (code != null) {
99 controller.add({ 100 controller.add({
100 'name': 'barcodeWeb', 101 'name': 'barcodeWeb',
1 import 'dart:async'; 1 import 'dart:async';
2 import 'dart:io'; 2 import 'dart:io';
3 -import 'dart:typed_data';  
4 3
5 import 'package:flutter/cupertino.dart'; 4 import 'package:flutter/cupertino.dart';
6 import 'package:flutter/foundation.dart'; 5 import 'package:flutter/foundation.dart';
@@ -119,4 +119,3 @@ mixin InternalTorchDetection on InternalStreamCreation { @@ -119,4 +119,3 @@ mixin InternalTorchDetection on InternalStreamCreation {
119 } 119 }
120 } 120 }
121 } 121 }
122 -  
@@ -20,7 +20,6 @@ class Code { @@ -20,7 +20,6 @@ class Code {
20 external Uint8ClampedList get binaryData; 20 external Uint8ClampedList get binaryData;
21 } 21 }
22 22
23 -  
24 class JsQrCodeReader extends WebBarcodeReaderBase 23 class JsQrCodeReader extends WebBarcodeReaderBase
25 with InternalStreamCreation, InternalTorchDetection { 24 with InternalStreamCreation, InternalTorchDetection {
26 JsQrCodeReader({required super.videoContainer}); 25 JsQrCodeReader({required super.videoContainer});
@@ -78,7 +77,8 @@ class JsQrCodeReader extends WebBarcodeReaderBase @@ -78,7 +77,8 @@ class JsQrCodeReader extends WebBarcodeReaderBase
78 /// Captures a frame and analyzes it for QR codes 77 /// Captures a frame and analyzes it for QR codes
79 Future<Code?> _captureFrame(VideoElement video) async { 78 Future<Code?> _captureFrame(VideoElement video) async {
80 if (localMediaStream == null) return null; 79 if (localMediaStream == null) return null;
81 - final canvas = CanvasElement(width: video.videoWidth, height: video.videoHeight); 80 + final canvas =
  81 + CanvasElement(width: video.videoWidth, height: video.videoHeight);
82 final ctx = canvas.context2D; 82 final ctx = canvas.context2D;
83 83
84 ctx.drawImage(video, 0, 0); 84 ctx.drawImage(video, 0, 0);
@@ -26,8 +26,10 @@ class JsZXingBrowserMultiFormatReader { @@ -26,8 +26,10 @@ class JsZXingBrowserMultiFormatReader {
26 abstract class Result { 26 abstract class Result {
27 /// raw text encoded by the barcode 27 /// raw text encoded by the barcode
28 external String get text; 28 external String get text;
  29 +
29 /// Returns raw bytes encoded by the barcode, if applicable, otherwise null 30 /// Returns raw bytes encoded by the barcode, if applicable, otherwise null
30 external Uint8ClampedList? get rawBytes; 31 external Uint8ClampedList? get rawBytes;
  32 +
31 /// Representing the format of the barcode that was decoded 33 /// Representing the format of the barcode that was decoded
32 external int? format; 34 external int? format;
33 } 35 }
@@ -87,7 +89,10 @@ abstract class Exception { @@ -87,7 +89,10 @@ abstract class Exception {
87 external String get message; 89 external String get message;
88 } 90 }
89 91
90 -typedef BarcodeDetectionCallback = void Function(Result? result, Exception? error); 92 +typedef BarcodeDetectionCallback = void Function(
  93 + Result? result,
  94 + Exception? error,
  95 +);
91 96
92 extension JsZXingBrowserMultiFormatReaderExt 97 extension JsZXingBrowserMultiFormatReaderExt
93 on JsZXingBrowserMultiFormatReader { 98 on JsZXingBrowserMultiFormatReader {