dart_barcode 1.0.0

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

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

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

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
2 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
85 / 100
Overall score:
Weighted score of the above. [more]
48

Platforms

Detected platforms: web, other

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

Suggestions

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

Dependencies

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