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

パッケージ詳細v1.0.4

qrcode

QRコードをスキャンするためのFlutterプラグイン。iOSではAVCaptureSession、Androidではzxingを使用します。

30日間ダウンロード
40
いいね数
37
Pub ポイント
40

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

flutter pub add qrcode

パッケージ概要

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

qrcode パッケージは、iOS および Android プラットフォーム向けに QR コードをスキャンするための Flutter プラグインです。iOS では、効率的なバーコード検出のために AVCaptureSession を使用し、Android では信頼性の高いスキャンパフォーマンスを確保するために ZXing ライブラリを使用しています。この軽量なソリューションにより、開発者は最小限の設定でアプリに QR コードスキャン機能を統合できます。リアルタイムスキャンをサポートし、デコードされたデータへの簡単なアクセスを提供するため、QR コードから迅速にデータを取得する必要があるアプリケーションに最適です。

用途

  • モバイル決済システム
  • イベントチケットの検証
  • 製品情報の照会
  • 非接触型データ共有
  • 在庫管理

主な機能

  • クロスプラットフォームQRスキャン
  • iOS with AVCaptureSession
  • Android with ZXing
  • リアルタイムスキャン
  • シンプルなAPI統合

適している対象

  • QRコードの読み取りが必要なアプリ
  • 在庫ツールを開発する開発者
  • 接触のないソリューションを構築するスタートアップ
  • ECおよび小売アプリ
  • イベントおよびチケットプラットフォーム

注意事項

  • 両方のプラットフォームでカメラ権限が必要です
  • QRコードのスキャンに限定(生成は不可)
  • カメラプレビュー用の追加UIが必要になる場合があります
  • パフォーマンスはデバイスのカメラの品質に依存します
  • QRコード以外のバーコードはサポートされていません

元の README

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

qrcode

A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.

Usage

Use this package as a library
Add dependency

Add this to your package's pubspec.yaml file:

dependencies:
  qrcode: ^1.0.5
Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get
Import it

Now in your Dart code, you can use:

import 'package:qrcode/qrcode.dart';
Basic
class _MyAppState extends State<MyApp> {
  QRCaptureController _captureController = QRCaptureController();

  bool _isTorchOn = false;

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

    _captureController.onCapture((data) {
      print('onCapture----$data');
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Stack(
          alignment: Alignment.center,
          children: <Widget>[
            QRCaptureView(controller: _captureController),
            Align(
              alignment: Alignment.bottomCenter,
              child: _buildToolBar(),
            )
          ],
        ),
      ),
    );
  }

  Widget _buildToolBar() {
    return Row(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            FlatButton(
              onPressed: () {
                _captureController.pause();
              },
              child: Text('pause'),
            ),
            FlatButton(
              onPressed: () {
                if (_isTorchOn) {
                  _captureController.torchMode = CaptureTorchMode.off;
                } else {
                  _captureController.torchMode = CaptureTorchMode.on;
                }
                _isTorchOn = !_isTorchOn;
              },
              child: Text('torch'),
            ),
            FlatButton(
              onPressed: () {
                _captureController.resume();
              },
              child: Text('resume'),
            ),
          ],
        );
  }
}

Integration

iOS

To use on iOS, you must add the following to your Info.plist

<key>NSCameraUsageDescription</key>
<string>Camera permission is required for qrcode scanning.</string>
<key>io.flutter.embedded_views_preview</key>
<true/>

カテゴリー

ソースリポジトリ

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

データはまだありません。