fluttertpc_scan:基于 Flutter 的二维码与条形码扫描项目

scan qrcode & barcode in widget tree. decode qrcode & barcode image from path.

分支1Tags0
文件最后提交记录最后更新时间
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前
1 年前

扫描

scan

在部件树中扫描二维码和条形码。

从路径中解码二维码和条形码图像。

如果您想生成二维码图像,请使用 qr_flutter

功能特点

  • 在部件树中使用 ScanView 显示扫描视图。
  • 自定义识别区域。
  • 使用 Scan.parse 从图像路径解码二维码。

准备工作

iOS

info.list

<key>NSCameraUsageDescription</key>
<string>Your Description</string>

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>

Android 是一种基于 Linux 内核的移动操作系统,广泛应用于智能手机和平板电脑中。

<uses-permission android:name="android.permission.CAMERA" />

<application>
  <meta-data
    android:name="flutterEmbedding"
    android:value="2" />
</application>

当然,我会按照您的要求进行翻译。请您提供需要翻译的英文文本和Markdown格式,我将会为您翻译成中文。

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()controller.pause() 来恢复/暂停摄像头。

controller.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.**{*;}

许可协议

麻省理工学院许可协议

项目介绍

scan qrcode & barcode in widget tree. decode qrcode & barcode image from path.

定制我的领域