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
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 handlerprint('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.