Camcode 是一個 Flutter Web 套件,透過平台通道利用流行的 JavaScript 庫來實現條碼和 QR 碼掃描。專為網路環境設計,可與 Flutter 應用程式無縫整合,使用裝置的相機提供即時掃描功能。該套件抽象了瀏覽器相機存取和 JavaScript 互操作性的複雜性,為開發者提供簡單的 API,無需深入了解網路特定的實作細節即可實作掃描功能。非常適合需要快速、可靠地讀取條碼或 QR 碼的網路應用。
適用情境
基於網絡的庫存管理
線上票務掃描
數位文件驗證
行動網頁結帳系統
快速產品資訊查詢
主要特色
使用原生 JavaScript 條碼庫
即時掃描 Flutter Web
透過 pub add 簡單整合
跨瀏覽器相容性
輕巧且快速
適合對象
Flutter Web 開發人員
需要條碼掃描的網頁應用
具有二維碼輸入要求的項目
開發者避免複雜的 JS 互操作
快速掃描功能原型設計
使用建議
僅適用於 Flutter Web
需要瀏覽器攝像頭權限
依賴外部 JavaScript 庫
僅限支援的條碼類型
不支援移動平台
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
camcode
A camera barcode scan library for Flutter Web
Getting Started
Add a javascript file for barcode scan
function detectBarcode(dataUrl, callback) {
// call here your favorite javascript barcode scan library// input must be an image dataUrl// output must be a single String// don't forget to trigger the call back in order to get the resultcallback(barcode);
}
Import javascript files into your index.html
<script src="LINK_TO_MY_AWESOME_JAVASCRIPT_BARCODE_SCAN_LIB"></script>
<scriptsrc="js/barcode.js"></script>// the javascript file with the detectBarcode function