diff --git a/lib/src/web/flutter_qr_web.dart b/lib/src/web/flutter_qr_web.dart index 22896ae..f062248 100644 --- a/lib/src/web/flutter_qr_web.dart +++ b/lib/src/web/flutter_qr_web.dart @@ -56,7 +56,6 @@ class _WebQrViewState extends State { // html.CanvasElement canvas; // html.CanvasRenderingContext2D ctx; bool _currentlyProcessing = false; - html.MediaRecorder? _mediaRecorder; QRViewControllerWeb? _controller; @@ -73,10 +72,6 @@ class _WebQrViewState extends State { Timer? _frameIntervall; - final _canvasKey = GlobalKey(); - - double _scaleFactor = 1; - @override void initState() { super.initState(); @@ -201,20 +196,6 @@ class _WebQrViewState extends State { } } - Future _captureImage() async { - if (_localStream == null) { - return null; - } - final canvas = - html.CanvasElement(width: video.videoWidth, height: video.videoHeight); - final ctx = canvas.context2D; - // canvas.width = video.videoWidth; - // canvas.height = video.videoHeight; - ctx.drawImage(video, 0, 0); - var dataUrl = canvas.toDataUrl('image/jpeg', 0.9); - return dataUrl; - } - @override Widget build(BuildContext context) { if (_errorMsg != null) { diff --git a/lib/src/web/jsqr.dart b/lib/src/web/jsqr.dart index 0c7a36f..386936c 100644 --- a/lib/src/web/jsqr.dart +++ b/lib/src/web/jsqr.dart @@ -3,7 +3,7 @@ library jsqr; import 'package:js/js.dart'; -@JS("jsQR") +@JS('jsQR') external Code jsQR(var data, int? width, int? height); @JS() diff --git a/lib/src/web/media.dart b/lib/src/web/media.dart index e8d9138..cacd527 100644 --- a/lib/src/web/media.dart +++ b/lib/src/web/media.dart @@ -1,12 +1,12 @@ // This is here because dart doesn't seem to support this properly // https://stackoverflow.com/questions/61161135/adding-support-for-navigator-mediadevices-getusermedia-to-dart -@JS("navigator.mediaDevices") +@JS('navigator.mediaDevices') library media_devices; import 'package:js/js.dart'; -@JS("getUserMedia") +@JS('getUserMedia') external Future getUserMedia(UserMediaOptions constraints); @JS()