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

パッケージ詳細v3.0.15

flutter_barcode_scanner_plus

Android および iOS でのバーコードスキャンをサポートするプラグインです。バーコード、QR コードなどをサポートしています。

AndroidiOS
30日間ダウンロード
1.1万
いいね数
20
Pub ポイント
160

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

flutter pub add flutter_barcode_scanner_plus

パッケージ概要

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

AndroidおよびiOSデバイスでのバーコードおよびQRコードのスキャンを可能にするFlutterプラグインです。QRコード、EAN、UPCなど、さまざまな種類のバーコードのキャプチャとデコードに簡単で信頼性の高いインターフェースを提供します。ネイティブ統合により、クロスプラットフォームで高速かつ正確なスキャンパフォーマンスを実現しています。在庫管理システム、チケットシステム、製品検索ツールなど、視覚的なコードを通じて迅速なデータ入力を必要とするアプリケーションに最適です。

用途

  • 在庫管理
  • チケットスキャン
  • 製品情報の照会
  • QRコードを用いたユーザー認証
  • モバイル決済

主な機能

  • 複数のバーコード形式をサポートしています
  • クロスプラットフォーム互換性(AndroidおよびiOS)
  • 高速スキャン
  • シンプルなAPI統合
  • リアルタイムプレビューのサポート

適している対象

  • 小売アプリ
  • イベントチケットシステム
  • 物流と倉庫管理
  • モバイル決済ソリューション
  • デジタル本人確認

注意事項

  • カメラの権限が必要です
  • バックグラウンド実行の設定が必要になる場合があります
  • パフォーマンスはデバイスのハードウェアによって異なります
  • モバイルプラットフォームに限定
  • iOSカメラアクセス用の追加構成

元の README

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

flutter_barcode_scanner_plus

A plugin for Flutter apps that adds barcode scanning support on both Android and iOS.

pub package

Demo gif

Try example

Just clone or download the repository, open the project in Android Studio/ VS Code, open pubspec.yaml and click on Packages get. Connect device and hit run. To run on iPhone you need to run from Xcode first time and just make pod install in example/ios then run from Xcode.

Getting Started

Follow the steps for Android and iOS

PLEASE FOLLOW iOS STEPS CAREFULLY

Android

:zap: Don't worry, you don't need to do anything.

iOS - Requires Swift support

Deployment target : 12

1. Fresh start:
  1. Create a new flutter project. Please check for Include swift support for iOS code.
  2. After creating new flutter project open /ios project in Xcode and set minimum deployment target to 12 and set Swift version to 5.
  3. After setting up the deployment target and swift version, close the Xcode then run pod install in /ios in flutter project.

You have done with basic configuration now proceed to section How to use.

2. Adding to existing flutter app:
If your existing ios code is Swift then you just need to do following.
  1. Set minimum deployment target to 12 and set Swift version to 5.
  2. Close the Xcode and run pod install in /ios in flutter project.
  3. Now proceed to section How to use.
If your existing ios code is Objective-C then you need to do following.
  1. Create a new flutter project with same name at different location (Don't forget to check Include swift support for iOS code while creating)
  2. Just copy newly created /ios folder from project and replace with existing /ios.
  3. Open ios project in Xcode and set minimum deployment target to 12 and set Swift version to 5.
  4. Run pod install in /ios

Note: If you did any changes in ios part before, you might need to make these configuration again

How to use ?

To use on iOS, you will need to add the camera usage description. To do that open the Xcode and add camera usage description in Info.plist.

<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>

After making the changes in Android ans iOS add flutter_barcode_scanner to pubspec.yaml

dependencies:
  ...
  flutter_barcode_scanner_plus: ^3.0.15
One time scan
  1. You need to import the package first.
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart';
  1. Then use the scanBarcode method to access barcode scanning.
String barcodeScanRes = await FlutterBarcodeScanner.scanBarcode(
                                                    COLOR_CODE,
                                                    CANCEL_BUTTON_TEXT,
                                                    isShowFlashIcon,
                                                    scanMode);

Here in scanBarcode,

COLOR_CODE is hex-color which is the color of line in barcode overlay you can pass color of your choice,

CANCEL_BUTTON_TEXT is a text of cancel button on screen you can pass text of your choice and language,

isShowFlashIcon is bool value used to show or hide the flash icon,

scanMode is a enum in which user can pass any of { QR, BARCODE, DEFAULT }, if nothing is passed it will consider a default value which will be QR. It shows the graphics overlay like for barcode and QR.

NOTE: Currently, scanMode is just to show the graphics overlay for barcode and QR. Any of this mode selected will scan both QR and barcode.

Continuous scan
  • If you need to scan barcodes continuously without closing camera use FlutterBarcodeScanner.getBarcodeStreamReceiver params will be same like FlutterBarcodeScanner.scanBarcode e.g.
FlutterBarcodeScanner.getBarcodeStreamReceiver("#ff6666", "Cancel", false, ScanMode.DEFAULT)
         .listen((barcode) {
         /// barcode to be used
         });
Contribution:

would :heart: to see any contribution, give :star: if you like

Contact:

E-mail: sarangthemamarjit123@gmail.com

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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