搜尋套件、儲存庫與 APP 分類

套件詳情v1.6.0

scan

在小部件樹中使用自定選項掃描二維碼與條碼。從路徑準確解碼二維碼與條碼影像。

AndroidiOS
近 30 天下載
1900
喜歡數
178
Pub 分數
130

安裝套件

flutter pub add scan

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

掃描套件可在 Flutter 小部件樹中直接啟用 QR 碼和條碼掃描,提供可自訂的整合選項。它能準確解碼來自影像路徑的 QR 碼和條碼,支援 Android 與 iOS 平台。專為在 Flutter 應用中順暢使用而設計,提供簡單的 API,無需原生程式碼即可嵌入掃描功能。適用於需要離線或按需讀取條碼的應用。

適用情境

  • 店內產品掃描
  • 數位票務驗證
  • 庫存管理
  • 透過QR碼進行使用者驗證
  • 文件數據提取

主要特色

  • 圖像路徑解碼
  • 可自定義的掃描選項
  • 跨平台支援(Android 與 iOS)
  • Widget 樹整合
  • 高精度解碼

適合對象

  • 零售應用
  • 事件票務系統
  • 物流追蹤
  • 行動支付整合
  • 數據採集工具

使用建議

  • 需要圖像文件輸入
  • 僅限靜態圖像掃描
  • 無即時攝像頭預覽
  • 取決於影像品質
  • 可能需要權限處理以存取檔案

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

scan

scan

scan qrcode & barcode in widget tree.

decode qrcode & barcode image from path.

if you want to generate qrcode image, you should use qr_flutter

Features
  • use ScanView in widget tree to show scan view.
  • custom identifiable area.
  • decode qrcode from image path by Scan.parse.
prepare
ios

info.list

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

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
android
<uses-permission android:name="android.permission.CAMERA" />

<application>
  <meta-data
    android:name="flutterEmbedding"
    android:value="2" />
</application>
scan: ^newest
import 'package:scan/scan.dart';
Usage
  • show scan view in widget tree
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
    },
  ),
),
  • you can use controller.resume() and controller.pause() resume/pause camera
controller.resume();
controller.pause();
  • get qrcode string from image path
String result = await Scan.parse(imagePath);
  • toggle flash light
controller.toggleTorchMode();
proguard-rules
-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.**{*;}

License

MIT License

所屬分類

原始碼儲存庫

使用此套件的專案