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

パッケージ詳細v1.1.2

barcode_flutter

Barcode flutter は、カスタムペインターを介してシンプルかつ高速なバーコードレンダリングを行うためのFlutterライブラリです。

30日間ダウンロード
138
いいね数
22
Pub ポイント
35

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

flutter pub add barcode_flutter

パッケージ概要

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

Barcode Flutter は、カスタムペインターを使用してバーコードを効率的にレンダリングするように設計された軽量なFlutterライブラリです。最小限のセットアップで、Flutterアプリ内にバーコード画像を直接生成できます。このライブラリはさまざまなバーコード形式をサポートしており、UIコンポーネントにスムーズに統合されます。シンプルさとパフォーマンスを重視して作られており、チケット発行、在庫管理、製品ラベルなど、リアルタイムでのバーコード生成が必要なアプリケーションに最適です。パッケージはオープンソースであり、Bigshipによってメンテナンスされています。

用途

  • アプリケーションでダイナミックなバーコードを生成する
  • UIコンポーネントにバーコードを統合する
  • 製品ラベルの作成
  • 在庫品目の追跡
  • チケットまたは領収書の表示
  • クイックスキャン対応コードの有効化

主な機能

  • カスタムペインターに基づくレンダリング
  • 複数のバーコード形式のサポート
  • 軽量で高速なパフォーマンス
  • シンプルなAPI統合
  • オープンソースで積極的にメンテナンスされています
  • 外部の依存関係なし

適している対象

  • バーコードのビジュアルが必要なモバイルアプリ開発者
  • リアルタイムのバーコード生成を必要とするアプリ
  • 効率と最小限のオーバーヘッドに焦点を当てたプロジェクト
  • 在庫またはチケットシステムと連携する開発者
  • Flutterの初心者がカスタムペイントを探索しています

注意事項

  • 視覚レンダリングに限定(スキャンなし)
  • 組み込みのバーコードデコードなし
  • バーコードデータの手動処理が必要です
  • 複雑なバーコード論理には適していません
  • 正しい入力フォーマット仕様に依存する

元の README

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

Barcode Flutter is a Flutter library for simple and fast Barcode rendering via custom painter

screenshot


Update Notes

1.1.2

  • Add Codabar support
  • Fix wrong pattern for value 102 of Code128 (#20)

1.1.0

  • Add ITF support
  • Add BarCodeParams class for future expandability

1.0.2

  • Fix EAN8 code invalid checksum bug

1.0.1

  • Fix issue. Scanning problem when code128 contains character 'M'

1.0.0

  • Initial release

Features

  • Supports code type: Code39, Code93, Code128, EAN13, EAN8, UPCA, UPCE
  • Supports render with or without text label
  • Supports adjusting the bar width
  • No internet connection required

Installing

You can install the package by adding the following lines to your pubspec.yaml:

dependencies:
    barcode_flutter: ^1.1.2

After adding the dependency to your pubspec.yaml you can run: flutter packages get or update your packages using your IDE.

Getting started

To start, import the dependency in your code:

import 'package:barcode_flutter/barcode_flutter.dart';

Next, to reander a Barcode (Code39 for example), you can use the following code:

BarCodeImage(
  params: Code39BarCodeParams(
    "1234ABCD",
    lineWidth: 2.0,                // width for a single black/white bar (default: 2.0)
    barHeight: 90.0,               // height for the entire widget (default: 100.0)
    withText: true,                // Render with text label or not (default: false)
  ),
  onError: (error) {               // Error handler
    print('error = $error');
  },
);

NOTE: You can only tweak the lineWidth parameter to change the entire widget's width. But value less than 2.0 will sometimes make the barcode scaner more difficult to recognize result correctly. 2.0 is a safe value for all code types.

Error handling: You have to make sure the code strings provided are valid. If you are not sure about the data, maybe it comes from user input or something, then setup onError method, and put your error handling logic there. Sometimes the library will render parts of the barcode if the data is invalid, and if that happens, I can't guarantee that the result can be recognized by a barcode scaner.

Example

See the example directory for a basic working example.

FAQ

Has it been tested in production? Can I use it in production?

Yep! I've test it both on Android and iOS devices. Feel free to test it with any barcode scanner.

How about the other barcode types ?

I've only implemented some most commonly used barcode types. But feel free to send PR to include more barcode types.

License

Barcode flutter is released under BSD license. See LICENSE for details.

カテゴリー

ソースリポジトリ

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