dart_barcode 1.0.0

  • README.md
  • Example
  • Installing
  • Versions
  • 49


Port of JsBarcode library. JsBarcode is a simple way to create different types of 1d barcodes. The plugin uses Html5Canvas/img/svg to generate and draw the barcode


A simple usage example:


<script async src="packages/dart_barcode/vendors/js/JsBarcode.all.min.js"></script>

<svg id="code"></svg>


import 'package:dart_barcode/dart_barcode.dart';

main() {
    new DartBarcode("#code").ean13("1234567890128").render();

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Update to JsBarcode v3.5.6


  • Initial version


// Copyright (c) 2015, <your name>. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library dart_barcode.example;

import 'dart:html';
import 'package:dart_barcode/dart_barcode.dart';

main() {
  Options opt = new Options(format: "CODE128", displayValue:true);
  new DartBarcode(querySelector("img"), "0123456789", opt);

  new DartBarcode("#code128", "Hi!");
  new DartBarcode("#ean-13").ean13("1234567890128").render();
  new DartBarcode("#ean-8").ean8("12345670").render();
  new DartBarcode("#ean-5").ean5("12345").render();
  new DartBarcode("#ean-2").ean2("12").render();
  new DartBarcode("#upc-a").upc("123456789012").render();
  new DartBarcode("#code39").code39("Hello").render();
  new DartBarcode("#itf-14").itf14("1234567890123").render();
  new DartBarcode("#msi").msi("123456").render();
  new DartBarcode("#pharmacode").pharmacode("12345").render();

  new DartBarcode(".barcode").init();
  new DartBarcode("#barcode")
      .options(new Options(font: "OCR-B")) // Will affect all barcodes
      .ean13("1234567890128", new Options(fontSize: 18, textMargin: 0))
      .blank(20) // Create space between the barcodes
      .ean5("12345", new Options(height: 85, textPosition: "top", fontSize: 16, marginTop: 15))

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  dart_barcode: "^1.0.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:dart_barcode/dart_barcode.dart';
Version Uploaded Documentation Archive
1.0.0 Dec 11, 2016 Go to the documentation of dart_barcode 1.0.0 Download dart_barcode 1.0.0 archive
0.0.5+1 May 11, 2016 Go to the documentation of dart_barcode 0.0.5+1 Download dart_barcode 0.0.5+1 archive
0.0.5 May 11, 2016 Go to the documentation of dart_barcode 0.0.5 Download dart_barcode 0.0.5 archive
0.0.4 May 11, 2016 Go to the documentation of dart_barcode 0.0.4 Download dart_barcode 0.0.4 archive
0.0.3 May 11, 2016 Go to the documentation of dart_barcode 0.0.3 Download dart_barcode 0.0.3 archive
0.0.2 Dec 12, 2015 Go to the documentation of dart_barcode 0.0.2 Download dart_barcode 0.0.2 archive
0.0.1 Dec 4, 2015 Go to the documentation of dart_barcode 0.0.1 Download dart_barcode 0.0.1 archive


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
20 / 100
Code health derived from static analysis. [more]
100 / 100
Reflects how tidy and up-to-date the package is. [more]
48 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: web, other

Primary library: package:dart_barcode/dart_barcode.dart with components: js.


  • Package is getting outdated.

    The package was released 79 weeks ago.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0
js ^0.6.0 0.6.1
Dev dependencies
browser ^0.10.0+2
test >=0.12.0 <0.13.0