barcode_image
2.0.3, released 4 years ago by nfet.net
Generates barcodes as image files using the Dart image library.
What it does
Provides functions to draw various barcode formats onto an Image object and export it as PNG. Includes a command‑line tool for quick barcode generation.
AI-written summary of version 2.0.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to create barcode images on the server or in a CLI tool.
- You want a pure‑Dart solution without native platform code.
Skip it when
- You need real‑time barcode scanning or camera integration.
- You require advanced UI widgets for displaying barcodes in Flutter.
Strengths
- No native dependencies; works on all Dart platforms.
- Simple API that works with the popular image package.
Weaknesses
- Only generates static images; no widget for Flutter UI.
- Limited to barcode formats supported by the underlying barcode package.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
import 'dart:io';
import 'package:image/image.dart';
import 'package:barcode_image/barcode_image.dart';
void main() {
final img = Image(width: 300, height: 120);
fill(img, color: ColorRgb8(255, 255, 255));
drawBarcode(img, Barcode.code128(), 'Test');
File('test.png').writeAsBytesSync(encodePng(img));
}Alternatives
Packages that do the same job and could replace barcode_image.
- image_cropper
A Flutter plugin for Android, iOS and Web supports cropping images
84Compare - pixer
High-performance Dart image manipulation backed by Rust FFI for resizing, cropping, and encoding.
71Compare - fc_native_image_resize
A Flutter plugin to resize images via native APIs.
69Compare - thumbnailer
Generate and display thumbnails for images, PDFs, and spreadsheets as Flutter widgets.
68Compare
Works with
Packages commonly used together with barcode_image: ones it builds on, ones built on it, and its own family.
- argsbarcode_image depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- imagebarcode_image depends on itPure Dart library to load, manipulate, encode, and decode various image formats.
- barcodebarcode_image depends on itBarcode generation library for Dart that can generate generic drawing operations for any backend.
- pdfSame familyA PDF generation library for Dart and Flutter using a widget-like layout system.
- barcode_widgetSame familyBarcode generation widget for Flutter