Pakete, Repositories und App-Kategorien suchen

Paketdetailsv1.1.2

barcode_flutter

Barcode flutter ist eine Flutter-Bibliothek für einfache und schnelle Barcodes Darstellung über einen benutzerdefinierten Painter.

30-Tage-Downloads
138
Likes
22
Pub-Punkte
35

Paket installieren

flutter pub add barcode_flutter

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Barcode Flutter ist eine leichte Flutter-Bibliothek, die für die effiziente Darstellung von Barcode mithilfe eines benutzerdefinierten Malers entwickelt wurde. Sie ermöglicht Entwicklern die direkte Erstellung von Barcode-Bildern innerhalb ihrer Flutter-Apps mit minimalem Setup. Die Bibliothek unterstützt verschiedene Barcode-Formate und integriert sich nahtlos in UI-Komponenten. Für Einfachheit und Leistung konzipiert, ist sie ideal für Anwendungen, die eine Echtzeit-Generierung von Barcodes erfordern, wie beispielsweise Ticketing, Bestandsverfolgung oder Produktetikettierung. Das Paket ist Open Source und wird von Bigship gepflegt.

Anwendungsfälle

  • Dynamische Barcodes in Apps generieren
  • Barcodes in UI-Komponenten integrieren
  • Produktetiketten erstellen
  • Bestandteile verfolgen
  • Tickets oder Quittungen anzeigen
  • Schnellscann-fähige Codes aktivieren

Hauptmerkmale

  • Benutzerdefiniertes Zeichnen-basierte Darstellung
  • Unterstützung mehrerer Barcode-Formate
  • Leicht und schnelle Leistung
  • Einfache API-Integration
  • Open Source und aktiv gepflegt
  • Keine externen Abhängigkeiten

Geeignet für

  • Mobile App Entwickler, die Barcode-Visualisierungen benötigen
  • Apps, die Echtzeit-Barcode-Erzeugung erfordern
  • Projekte, die auf Effizienz und geringen Overhead fokussiert sind
  • Entwickler, die mit Bestands- oder Ticketing-Systemen arbeiten
  • Flutter-Anfänger erkunden benutzerdefinierte Malerei

Hinweise

  • Beschränkt auf visuelle Darstellung (kein Scannen)
  • Keine integrierte Barcode-Decodierung
  • Erfordert manuelle Behandlung der Barcode-Daten
  • Nicht geeignet für komplexe Barcode-Logik
  • Abhängig von der korrekten Eingabeformat-Spezifikation

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Barcode Flutter is a Flutter library for simple and fast Barcode rendering via custom painter

screenshot


Update Notes

1.1.2

  • Add Codabar support
  • Fix wrong pattern for value 102 of Code128 (#20)

1.1.0

  • Add ITF support
  • Add BarCodeParams class for future expandability

1.0.2

  • Fix EAN8 code invalid checksum bug

1.0.1

  • Fix issue. Scanning problem when code128 contains character 'M'

1.0.0

  • Initial release

Features

  • Supports code type: Code39, Code93, Code128, EAN13, EAN8, UPCA, UPCE
  • Supports render with or without text label
  • Supports adjusting the bar width
  • No internet connection required

Installing

You can install the package by adding the following lines to your pubspec.yaml:

dependencies:
    barcode_flutter: ^1.1.2

After adding the dependency to your pubspec.yaml you can run: flutter packages get or update your packages using your IDE.

Getting started

To start, import the dependency in your code:

import 'package:barcode_flutter/barcode_flutter.dart';

Next, to reander a Barcode (Code39 for example), you can use the following code:

BarCodeImage(
  params: Code39BarCodeParams(
    "1234ABCD",
    lineWidth: 2.0,                // width for a single black/white bar (default: 2.0)
    barHeight: 90.0,               // height for the entire widget (default: 100.0)
    withText: true,                // Render with text label or not (default: false)
  ),
  onError: (error) {               // Error handler
    print('error = $error');
  },
);

NOTE: You can only tweak the lineWidth parameter to change the entire widget's width. But value less than 2.0 will sometimes make the barcode scaner more difficult to recognize result correctly. 2.0 is a safe value for all code types.

Error handling: You have to make sure the code strings provided are valid. If you are not sure about the data, maybe it comes from user input or something, then setup onError method, and put your error handling logic there. Sometimes the library will render parts of the barcode if the data is invalid, and if that happens, I can't guarantee that the result can be recognized by a barcode scaner.

Example

See the example directory for a basic working example.

FAQ

Has it been tested in production? Can I use it in production?

Yep! I've test it both on Android and iOS devices. Feel free to test it with any barcode scanner.

How about the other barcode types ?

I've only implemented some most commonly used barcode types. But feel free to send PR to include more barcode types.

License

Barcode flutter is released under BSD license. See LICENSE for details.

Kategorien

Quell-Repository

Projekte, die dieses Paket verwenden