パッケージ、リポジトリ、アプリカテゴリを検索

pretty_qr_code のカバー
パッケージ詳細v3.6.0

pretty_qr_code

QR コードを簡単にレンダリングできる、高度にカスタマイズ可能な Flutter ウィジェットです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
23.2万
いいね数
587
Pub ポイント
140

パッケージをインストール

flutter pub add pretty_qr_code

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

QRコードを簡単にレンダリングするための高度にカスタマイズ可能なFlutterウィジェットです。サイズ、色、形状、ロゴ統合などのオプションを使って、QRコードの外観をカスタマイズできます。Android、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォームアプリに最適です。クリーンなAPIと組み込みのスタイル機能により、外部依存なしでQRコードの生成を簡素化します。ブランド化またはインタラクティブなQRコードが必要なアプリに最適です。

用途

  • ブランドQRコードの生成
  • QR コードにロゴを追加する
  • ウェブおよびモバイルアプリにQRコードを埋め込む
  • ダイナミックQRコードの作成
  • ダッシュボードにQRコードを表示する

主な機能

  • カスタマイズ可能な色とサイズ
  • ロゴオーバーレイのサポート
  • クロスプラットフォーム互換性
  • シンプルな API
  • 高度にカスタマイズ可能なデザイン
  • 組み込みエラー補正

適している対象

  • モバイルアプリ開発者
  • Webアプリケーション作成者
  • デザインに焦点を当てたプロジェクト
  • ECおよびマーケティングアプリ
  • ユーザーが生成するQRコードを必要とするアプリ

注意事項

  • 大規模バッチに対してパフォーマンス最適化が必要になる可能性があります
  • 限定された高度なQRデータエンコーディングオプション
  • ロゴのスケーリングは読みやすさに影響を与える可能性があります
  • 高容量のQRコード生成には適していません
  • プラットフォーム固有のレンダリング機能に依存します

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pretty QR Code

Pub Likes on pub.dev Star on Github License: MIT

A highly customizable Flutter widget that makes it easy to render QR codes. Built on top of the qr package.

Features

  • Live Preview
  • Shapes - The widget provides functionality for rendering various built-in shapes, namely smooth, squares and dots, or you can even create your patterns using the package API.
  • Themes - Allows you easily switch between themes using the material theme extension.
  • Branding - Configure the display of the embedded image and adjust its style to best fit your needs.
  • Exporting - Save the QR сode as an image for sharing, embedding, or anything else.
  • Customization - Customize the appearance by setting the shape color or filling with a gradient.

If you want to say thank you, star us on GitHub or like us on pub.dev.

Usage

First, follow the package installation instructions and add a PrettyQrView widget to your app:

PrettyQrView.data(
  data: 'lorem ipsum dolor sit amet',
  decoration: const PrettyQrDecoration(
    image: PrettyQrDecorationImage(
      image: AssetImage('images/flutter.png'),
    ),
    quietZone: PrettyQrQuietZone.standart,
  ),
)

If you want to pass non-string data or want to specify a QR version, consider using the default PrettyQrView constructor:

@protected
late QrImage qrImage;

@override
void initState() {
  super.initState();

  final qrCode = QrCode(
    8,
    QrErrorCorrectLevel.H,
  )..addData('lorem ipsum dolor sit amet');

  qrImage = QrImage(qrCode);
}

@override
Widget build(BuildContext context) {
  return PrettyQrView(
    qrImage: qrImage,
    decoration: const PrettyQrDecoration(),
  );
}

Note: Do not create QrImage inside the build method; otherwise, you may have an undesired jank in the UI thread.

Combine several styles

To combine multiple styles in a single QR code, you can use PrettyQrCustomShape, as shown in the example below:

PrettyQrView.data(
  data: 'lorem ipsum dolor sit amet',
  decoration: const PrettyQrDecoration(
    shape: PrettyQrShape.custom(
      PrettyQrSquaresSymbol(),
      finderPattern: PrettyQrSmoothSymbol(),
      alignmentPatterns: PrettyQrDotsSymbol(),
    ),
  ),
)

Save the symbol as an image

You can save the QR code as an image using the toImage or toImageAsBytes extension methods that apply to QrImage. Optionally, the configuration parameter may be used to set additional saving options, such as pixel ratio or text direction.

final qrCode = QrCode.fromData(
  data: 'lorem ipsum dolor sit amet',
  errorCorrectLevel: QrErrorCorrectLevel.H,
);

final qrImage = QrImage(qrCode);
final qrImageBytes = await qrImage.toImageAsBytes(
  size: 512,
  format: ImageByteFormat.png,
  decoration: const PrettyQrDecoration(),
);

See the example folder for more code samples of the various possibilities.

Contributing

Contributions are welcomed!

Here is a curated list of how you can help:

  • Fix typos/grammar mistakes
  • Report parts of the documentation that are unclear
  • Report bugs and scenarios that are difficult to implement

Planned for future release(s)

  • Quiet Zone
  • Gradient filling
  • Export as image
  • Error handling API
  • Background color for QR code
  • Timing Patterns and Alignment Patterns
  • Support custom clippers for embedded images (#38)
  • Export as vector image (#42)

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト