barcode_widget 1.5.0

Flutter Android iOS web

Barcode generation widget for Flutter with support for standard barcodes.

barcode_widget #

Barcode Widget for flutter.

Buy Me A Coffee

This widget uses pub:barcode to generate any supported Barcodes.

Barcode Demo

Live example with Flutter Web #

https://davbfr.github.io/dart_barcode/

Getting Started #

In your flutter project add the dependency:

dependencies:
  ...
  barcode_widget:

For help getting started with Flutter, view the online documentation.

Usage example #

Import barcode_widget.dart

import 'package:barcode_widget/barcode_widget.dart';

Use the widget directly

BarcodeWidget(
  barcode: Barcode.code128(),
  data: 'Hello Flutter',
);

To display an custom error message if the barcode is not valid, use:

BarcodeWidget(
  barcode: Barcode.ean13(),
  data: 'Hello',
  errorBuilder: (context, error) => Center(child: Text(error)),
);

Many layout options are available like: width, height, margin, padding, colors, etc.

To add a logo on top of a QrCode, use Flutter's composing abilities while increasing the error recovery density:

Stack(
  alignment: Alignment.center,
  children: [
    BarcodeWidget(
      barcode: Barcode.qrCode(
        errorCorrectLevel: BarcodeQRCorrectionLevel.high,
      ),
      data: 'https://pub.dev/packages/barcode_widget',
      width: 200,
      height: 200,
    ),
    Container(
      color: Colors.white,
      width: 60,
      height: 60,
      child: const FlutterLogo(),
    ),
  ],
)
22
likes
110
pub points
92%
popularity

Publisher

nfet.net

Barcode generation widget for Flutter with support for standard barcodes.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

barcode, flutter, meta

More

Packages that depend on barcode_widget