Skip to content
pubscout

barcode_image

2.0.3, released 4 years ago by nfet.net

Generates barcodes as image files using the Dart image library.

WASM-ready
$ flutter pub add barcode_image
Source repository

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.

Works with

Packages commonly used together with barcode_image: ones it builds on, ones built on it, and its own family.