Ver código fonte

Fixed Flutter analysis issues

flutter-beta
TheOneWithTheBraid 5 anos atrás
pai
commit
d14278af02
3 arquivos alterados com 3 adições e 22 exclusões
  1. +0
    -19
      lib/src/web/flutter_qr_web.dart
  2. +1
    -1
      lib/src/web/jsqr.dart
  3. +2
    -2
      lib/src/web/media.dart

+ 0
- 19
lib/src/web/flutter_qr_web.dart Ver arquivo

@@ -56,7 +56,6 @@ class _WebQrViewState extends State<WebQrView> {
// html.CanvasElement canvas;
// html.CanvasRenderingContext2D ctx;
bool _currentlyProcessing = false;
html.MediaRecorder? _mediaRecorder;

QRViewControllerWeb? _controller;

@@ -73,10 +72,6 @@ class _WebQrViewState extends State<WebQrView> {

Timer? _frameIntervall;

final _canvasKey = GlobalKey();

double _scaleFactor = 1;

@override
void initState() {
super.initState();
@@ -201,20 +196,6 @@ class _WebQrViewState extends State<WebQrView> {
}
}

Future<String?> _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) {


+ 1
- 1
lib/src/web/jsqr.dart Ver arquivo

@@ -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()


+ 2
- 2
lib/src/web/media.dart Ver arquivo

@@ -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<dynamic> getUserMedia(UserMediaOptions constraints);

@JS()


Carregando…
Cancelar
Salvar