패키지, 저장소 및 앱 카테고리 검색

패키지 상세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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트