dart_barcode 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 29

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.0

  • Update to JsBarcode v3.5.6

0.0.1

  • Initial version

example/dart_barcode.dart

// 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))
      .render();
}

Use this package as a library

1. Depend on it

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


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
58
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
29
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.13.0 <2.0.0