p-mazhnik

flutter format

... ... @@ -94,7 +94,8 @@ class MobileScannerWebPlugin {
cameraFacing: cameraFacing,
);
_barCodeStreamSubscription = barCodeReader.detectBarcodeContinuously().listen((code) {
_barCodeStreamSubscription =
barCodeReader.detectBarcodeContinuously().listen((code) {
if (code != null) {
controller.add({
'name': 'barcodeWeb',
... ...
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
... ...
... ... @@ -119,4 +119,3 @@ mixin InternalTorchDetection on InternalStreamCreation {
}
}
}
... ...
... ... @@ -20,7 +20,6 @@ class Code {
external Uint8ClampedList get binaryData;
}
class JsQrCodeReader extends WebBarcodeReaderBase
with InternalStreamCreation, InternalTorchDetection {
JsQrCodeReader({required super.videoContainer});
... ... @@ -78,7 +77,8 @@ class JsQrCodeReader extends WebBarcodeReaderBase
/// Captures a frame and analyzes it for QR codes
Future<Code?> _captureFrame(VideoElement video) async {
if (localMediaStream == null) return null;
final canvas = CanvasElement(width: video.videoWidth, height: video.videoHeight);
final canvas =
CanvasElement(width: video.videoWidth, height: video.videoHeight);
final ctx = canvas.context2D;
ctx.drawImage(video, 0, 0);
... ...
... ... @@ -26,8 +26,10 @@ class JsZXingBrowserMultiFormatReader {
abstract class Result {
/// raw text encoded by the barcode
external String get text;
/// Returns raw bytes encoded by the barcode, if applicable, otherwise null
external Uint8ClampedList? get rawBytes;
/// Representing the format of the barcode that was decoded
external int? format;
}
... ... @@ -87,7 +89,10 @@ abstract class Exception {
external String get message;
}
typedef BarcodeDetectionCallback = void Function(Result? result, Exception? error);
typedef BarcodeDetectionCallback = void Function(
Result? result,
Exception? error,
);
extension JsZXingBrowserMultiFormatReaderExt
on JsZXingBrowserMultiFormatReader {
... ...