Barcode Finder 是一個 Flutter 外掛程式,專門用於從影像和 PDF 檔案中提取條碼和 QR 碼。它在 Android 上使用 Zxing,並在 iOS 上結合 Zxing 與 Zbar,確保跨平台的可靠掃描。此套件支援一維與二維條碼格式,非常適合文件處理、庫存追蹤與資料擷取應用。可輕鬆整合至 Flutter 應用,設定簡單。
適用情境
從掃描的文件中讀取條碼
從圖像中提取二維碼
處理帶有嵌入條碼的PDF檔案
從物理標籤自動錄入數據
在零售應用中掃描產品資訊
主要特色
支援 Android 和 iOS 平台
使用 Zxing 和 Zbar 實現高精度
處理圖像和PDF檔案
跨平台一致性
透過 Flutter pub 簡單整合
適合對象
需要條碼掃描的移動應用
庫存和物流系統
零售和電子商務工具
文件數位化工作流程
需要快速提取數據的應用程式
使用建議
需要 iOS 和 Android 的原生依賴項
可能需要額外的權限才能存取檔案
性能取決於影像品質
僅限支援的條碼類型
未針對即時攝像頭掃描進行優化
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
Barcode Finder
A flutter plugin for barcode scanner that works on both iOS and Android. Provides functionality for scanning several formats of 1D and 2D barcodes.
It uses ML-kit on Android and iOS to detect codes from PDF and Image files.
Getting Started
Depend on it
Add this to your package's pubspec.yaml file:
dependencies:barcode_finder:latestversion
Android Platform
API 21 is the minimum supported for Android.
Usage
Lets take a look at how to use BarcodeFinder to scan any PDF or image File using File Picker as a auxiliar plugin.
Future<String?> scanFile() async {
// Used to pick a file from device storagefinal pickedFile = awaitFilePicker.platform.pickFiles();
if (pickedFile != null) {
final filePath = pickedFile.files.single.path;
if (filePath != null) {
returnawaitBarcodeFinder.scanFile(path: path);
}
}
}
Make sure you are passing a valid and permissioned path to BarcodeFinder.scanFile, in the exemple above, the package FilePicker provides it for us.