dart_barcode 1.0.1

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

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

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.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';
  
Version Uploaded Documentation Archive
1.0.1 Sep 11, 2018 Go to the documentation of dart_barcode 1.0.1 Download dart_barcode 1.0.1 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]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

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

  • Dart: 2.0.0
  • pana: 0.12.4

Platforms

Detected platforms: web, other

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

Maintenance issues and suggestions

Use analysis_options.yaml. (-10 points)

Rename old .analysis_options file to analysis_options.yaml.

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

The description is too short. (-20 points)

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

Dependencies

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