dart_barcode 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 66

dart_barcode #

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

Usage #

A simple usage example:

index.html #

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

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

main.dart #

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.

Changelog #

1.0.1 #

  • Support dart 2

1.0.0 #

  • Update to JsBarcode v3.5.6

0.0.1 #

  • 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
          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.1

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';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: web, other

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

Health issues and suggestions

Document public APIs. (-1 points)

67 out of 67 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Use analysis_options.yaml. (-10 points)

Change the name of your package's .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-8.22 points)

The package was last published 56 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 < 3.0.0
js ^0.6.0 0.6.1+1
Dev dependencies
build_runner >=0.8.10 <0.11.0
build_web_compilers >=0.3.6 <0.5.0