浏览代码

Formatting code

flutter-beta
Tihomirov 4 年前
父节点
当前提交
45b940744b
共有 2 个文件被更改,包括 9 次插入6 次删除
  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 查看文件

@@ -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 查看文件

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


正在加载...
取消
保存