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

flutter_qr_reader 封面
套件詳情v1.0.5

flutter_qr_reader

二維碼(掃描二維碼和圖片)識別(AndroidView/UiKitView)

AndroidiOS
近 30 天下載
1.2萬
喜歡數
80
Pub 分數
125

安裝套件

flutter pub add flutter_qr_reader

套件介紹

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

一個用於從影像掃描並讀取QR碼的Flutter套件,支援即時攝影機掃描與影像基礎辨識。它利用平台檢視(AndroidView/UiKitView)在Android與iOS上整合原生掃描功能。適用於需要快速從QR碼提取資料的應用程式,例如支付系統、票務或庫存追蹤。此套件輕量且設計為可輕鬆整合,設定最少。

適用情境

  • 應用中的即時二維碼掃描
  • 從儲存的圖像中讀取二維碼
  • 支付和票務驗證系統
  • 庫存和資產追蹤
  • 透過QR碼進行使用者驗證
  • 資料輸入自動化

主要特色

  • 支援即時攝像頭掃描
  • 基於圖像的二維碼識別
  • 原生平台視圖整合
  • 跨平台相容性(iOS 與 Android)
  • 簡單的 API 用於整合
  • 程式碼檢測的高準確度

適合對象

  • 需要二維碼掃描的移動應用
  • 電子商務和零售應用
  • 活動票務平台
  • 物流和供應鏈工具
  • 開發條形碼解決方案的開發團隊

使用建議

  • 需要行動裝置上的相機權限
  • 可能需要為iOS相機存取進行額外設定
  • 性能取決於設備硬體
  • 僅限二維碼類型(不包括其他條碼)
  • 背景掃描不支援
  • 影像品質影響辨識成功機率

原始 README

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

flutter_qr_reader

QR code (scan code / picture) recognition (AndroidView/UiKitView)

DEMO

demo

demo

Getting Started

import 'package:flutter_qr_reader/flutter_qr_reader.dart';

// 识别图片
final String data = await FlutterQrReader.imgScan(File);

// 嵌入视图
QrReaderView(
  width: 320,
  height: 350,
  callback: (container) {},
)
// 打开手电筒
..setFlashlight
// 开始扫码
..startCamera
// 结束扫码
..stopCamera
For IOS

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

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

And you will need provide the description of camera's permission to work properly, otherwise will crash your app.

  <key>NSCameraUsageDescription</key>
	<string>The porpuse explaining why you will use the camera</string>

Built-in UI

Widget build(BuildContext context) {
    return new Scaffold(
      body: QrcodeReaderView(key: qrViewKey, onScan: onScan),
    );
}

GlobalKey<QrcodeReaderViewState> qrViewKey = GlobalKey();

Future onScan(String data) async {
    await showCupertinoDialog(
      context: context,
      builder: (context) {
        return CupertinoAlertDialog(
          title: Text("扫码结果"),
          content: Text(data),
          actions: <Widget>[
            CupertinoDialogAction(
              child: Text("确认"),
              onPressed: () => Navigator.pop(context),
            )
          ],
        );
      },
    );
    qrViewKey.currentState.startScan();
}

所屬分類

原始碼儲存庫

使用此套件的專案