瀏覽代碼

Merge pull request #227 from juliuscanute/204-shapeborder

Updated ShapeBorder to QrScannerOverlayShape
flutter-beta
Julian Steenbakker 5 年之前
committed by GitHub
父節點
當前提交
e671d8ca95
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. +4
    -5
      lib/src/qr_code_scanner.dart

+ 4
- 5
lib/src/qr_code_scanner.dart 查看文件

@@ -34,7 +34,7 @@ class QRView extends StatefulWidget {

/// Use [overlay] to provide an overlay for the view.
/// This can be used to create a certain scan area.
final ShapeBorder overlay;
final QrScannerOverlayShape overlay;

/// Use [overlayMargin] to provide a margin to [overlay]
final EdgeInsetsGeometry overlayMargin;
@@ -73,9 +73,8 @@ class _QRViewState extends State<QRView> {
bool onNotification(notification) {
Future.microtask(() => {
QRViewController.updateDimensions(widget.key, _channel,
scanArea: widget.overlay != null
? (widget.overlay as QrScannerOverlayShape).cutOutSize
: 0.0)
scanArea:
widget.overlay != null ? widget.overlay.cutOutSize : 0.0)
});
return false;
}
@@ -126,7 +125,7 @@ class _QRViewState extends State<QRView> {
// We pass the cutout size so that the scanner respects the scan area.
var cutOutSize = 0.0;
if (widget.overlay != null) {
cutOutSize = (widget.overlay as QrScannerOverlayShape).cutOutSize;
cutOutSize = widget.overlay.cutOutSize;
}

_channel = MethodChannel('net.touchcapture.qr.flutterqr/qrview_$id');


Loading…
取消
儲存