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

パッケージ詳細v3.0.0

camcode

お気に入りのJavaScriptライブラリを使ってFlutter Web用のカメラバーコードスキャナー

30日間ダウンロード
92
いいね数
45
Pub ポイント
60

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

flutter pub add camcode

パッケージ概要

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

Camcode は、プラットフォームチャネルを通じて人気のある JavaScript ライブラリを利用することで、バーコードおよび QR コードのスキャンを可能にする Flutter Web パッケージです。ウェブ環境専用に設計されており、デバイスのカメラを使用してリアルタイムのスキャン機能を Flutter アプリケーションにシームレスに統合します。このパッケージは、ブラウザのカメラアクセスや JavaScript の相互運用性の複雑さを抽象化し、開発者がウェブ固有の実装詳細について深く知らなくてもスキャン機能を簡単に実装できるシンプルな API を提供します。迅速かつ信頼性の高いバーコードまたは QR コード読み取りが必要なウェブアプリに最適です。

用途

  • ウェブベースの在庫管理
  • オンラインチケットスキャン
  • デジタル文書の検証
  • モバイルウェブチェックアウトシステム
  • 迅速な製品情報検索

主な機能

  • ネイティブな JavaScript バーコードライブラリを使用
  • Flutter Webでのリアルタイムスキャン
  • pub add を通じた簡単なインテグレーション
  • クロスブラウザ互換性
  • 軽量で高速

適している対象

  • Flutter Web開発者
  • バーコードスキャンが必要なウェブアプリ
  • QRコード入力要件のあるプロジェクト
  • 複雑なJS相互運用を避ける開発者
  • 迅速スキャン機能のプロトタイピング

注意事項

  • Flutter Webでのみ動作します
  • ブラウザのカメラ権限が必要です
  • 外部のJavaScriptライブラリに依存しています
  • サポートされているバーコードタイプに限定
  • モバイルプラットフォームに対応していません

元の README

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

camcode

A camera barcode scan library for Flutter Web

Web build status

Getting Started

Add a javascript file for barcode scan

function detectBarcode(dataUrl, callback) {

    // call here your favorite javascript barcode scan library
    // input must be an image dataUrl
    // output must be a single String

    // don't forget to trigger the call back in order to get the result
    callback(barcode);
}

Import javascript files into your index.html

<script src="LINK_TO_MY_AWESOME_JAVASCRIPT_BARCODE_SCAN_LIB"></script>
<script src="js/barcode.js"></script> // the javascript file with the detectBarcode function

Use it

import 'package:camcode/cam_code_scanner.dart';

showDialog(
    context: context,
    builder: (context) => CamCodeScanner(
    width: MediaQuery.of(context).size.width,
    height: MediaQuery.of(context).size.height,
    refreshDelayMillis: 200,
    onBarcodeResult: (barcode) {
        // do whatever you want
    },
    minimalResultCount: 2,
    ),
);

More options

Manually release resources

Sometimes, depending on your camcode usage, you may need to release resources manually.

1- To do so, create first a controller for the scanner

// Create a controller to send instructions to scanner
  final CamCodeScannerController _controller = CamCodeScannerController();

2- Then, add it to the CamCodeScanner

CamCodeScanner(
    width: ...,
    height: ...,
    refreshDelayMillis: ...,
    onBarcodeResult: (barcode) {
        ...
    },
    controller: _controller,
),

3- And finally, just call releaseResources() method when required

ElevatedButton(
    onPressed: () {
        _controller.releaseResources();
    },
    child: Text('Release resources'),
),

Calling this method will close the camera and stop the scanner process

カテゴリー

依存関係

依存関係一覧 1 件

  • js^0.6.2

ソースリポジトリ

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

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