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

套件詳情v4.0.1

qr

一個用於 Dart 的 QR 碼產生程式庫。支援 QR 碼版本 1 到 40、錯誤校正與冗餘。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
489萬
喜歡數
265
Pub 分數
160

安裝套件

flutter pub add qr

套件介紹

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

qr 套件是一個用於產生 QR 碼的 Dart 庫,支援版本 1 到 40,並可自訂錯誤校正等級。它讓開發者能夠建立可擴展、可靠的 QR 碼,適用於各種應用場景。此套件輕量且相容於所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。它提供簡單的 API,可將文字、網址及其他資料編碼為 QR 碼影像。非常適合需要產生條碼而無需外部相依性的應用。

適用情境

  • 產生網址的二維碼
  • 建立產品或票證識別碼
  • 透過QR碼啟用聯絡人分享
  • 支援離線資料傳輸
  • 促進應用連結
  • 在可列印材質中嵌入資訊

主要特色

  • 支援QR版本1–40
  • 多重錯誤校正級別
  • 跨平台相容性
  • 用於編碼資料的簡單 API
  • 高度可定制的輸出
  • 輕便高效

適合對象

  • 行動應用開發者
  • Web 應用程式創建者
  • 桌面應用程式建構工具
  • 庫存或票務系統
  • 行銷和活動應用
  • 教育工具

使用建議

  • 需要手動處理圖像渲染
  • 無內建 UI 組件
  • 錯誤校正會影響大小和可讀性
  • 僅限QR碼產生
  • 未包含解碼功能
  • 輸出格式取決於外部渲染

原始 README

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

A QR code generation package for Dart.

Pub Package package publisher CI

Features

  • Supports QR code versions 1 - 40
  • Error correction / redundancy
  • ECI (Extended Channel Interpretation) support

Demo

A rich, HTML demo can be found at: qr.kevmoo.com.

QR Code Generator Demo

Getting started

To start, import the dependency in your code:

import 'package:qr/qr.dart';

To build your QR code data you should do so as such:

final qrCode = QrCode(
  payload: QrPayload.fromString('Hello, world in QR form!'),
  errorCorrectLevel: QrErrorCorrectLevel.low,
);
final qrImage = QrImage(qrCode);

To enable Extended Channel Interpretation (ECI) mode or build multi-part data, you can use QrPayload:

final payload = QrPayload()
  ..addECI(QrEciValue.utf8)
  ..addString('Hello, world in QR form!');

final qrCode = QrCode(
  payload: payload,
  errorCorrectLevel: QrErrorCorrectLevel.low,
);

Now you can use your qrImage instance to render a graphical representation of the QR code. A basic implementation would be as such:

for (var x = 0; x < qrImage.moduleCount; x++) {
  for (var y = 0; y < qrImage.moduleCount; y++) {
    if (qrImage.isDark(y, x)) {
      // render a dark square on the canvas
    }
  }
}

See the example directory for further details.

Packages that use package:qr

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

所在榜單