Pārlūkot izejas kodu

Formatting code

flutter-beta
Tihomirov pirms 4 gadiem
vecāks
revīzija
45b940744b
2 mainītis faili ar 9 papildinājumiem un 6 dzēšanām
  1. +1
    -1
      lib/src/qr_code_scanner.dart
  2. +8
    -5
      lib/src/qr_scanner_overlay_shape.dart

+ 1
- 1
lib/src/qr_code_scanner.dart Parādīt failu

@@ -334,7 +334,7 @@ class QRViewController {
await channel.invokeMethod('setDimensions', {
'width': renderBox.size.width,
'height': renderBox.size.height,
'scanArea': overlay?.cutOutWidth ?? 0,//Todo
'scanArea': overlay?.cutOutWidth ?? 0, //Todo
'scanAreaOffset': overlay?.cutOutBottomOffset ?? 0
});
return true;


+ 8
- 5
lib/src/qr_scanner_overlay_shape.dart Parādīt failu

@@ -76,11 +76,14 @@ class QrScannerOverlayShape extends ShapeBorder {
final borderWidthSize = width / 2;
final height = rect.height;
final borderOffset = borderWidth / 2;
final _borderLength = borderLength > min(cutOutHeight, cutOutHeight) / 2 + borderWidth * 2
? borderWidthSize / 2
: borderLength;
final _cutOutWidth = cutOutWidth < width ? cutOutWidth : width - borderOffset;
final _cutOutHeight = cutOutHeight < height ? cutOutHeight : height - borderOffset;
final _borderLength =
borderLength > min(cutOutHeight, cutOutHeight) / 2 + borderWidth * 2
? borderWidthSize / 2
: borderLength;
final _cutOutWidth =
cutOutWidth < width ? cutOutWidth : width - borderOffset;
final _cutOutHeight =
cutOutHeight < height ? cutOutHeight : height - borderOffset;

final backgroundPaint = Paint()
..color = overlayColor


Notiek ielāde…
Atcelt
Saglabāt