v1.6.0
scan
在小部件樹中使用自定選項掃描二維碼與條碼。從路徑準確解碼二維碼與條碼影像。
178喜歡 1550近 30 天下載130Pub 分數
AndroidiOS
在 widget 樹中掃描二維碼並從圖像解碼二維碼
{"sdk":"flutter"}{"sdk":"flutter"}以下為英文專案原文快照,最新內容請造訪 GitHub。
scan qrcode & barcode in widget tree.
decode qrcode & barcode image from path.
if you want to generate qrcode image, you should use qr_flutter
ScanView in widget tree to show scan view.Scan.parse.info.list
<key>NSCameraUsageDescription</key>
<string>Your Description</string>
<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
<uses-permission android:name="android.permission.CAMERA" />
<application>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
scan: ^newest
import 'package:scan/scan.dart';
ScanController controller = ScanController();
String qrcode = 'Unknown';
Container(
width: 250, // custom wrap size
height: 250,
child: ScanView(
controller: controller,
// custom scan area, if set to 1.0, will scan full area
scanAreaScale: .7,
scanLineColor: Colors.green.shade400,
onCapture: (data) {
// do something
},
),
),
controller.resume() and controller.pause() resume/pause cameracontroller.resume();
controller.pause();
String result = await Scan.parse(imagePath);
controller.toggleTorchMode();
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
MIT License