barcode_widget

Creator: coderz1093

Last updated:

Add to Cart

Description:

barcode widget

barcode_widget #
Barcode Widget for flutter.

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

Live example with Flutter Web #
https://davbfr.github.io/dart_barcode/
Getting Started #
In your flutter project add the dependency:
dependencies:
...
barcode_widget:
copied to clipboard
For help getting started with Flutter, view the online
documentation.
Usage example #
Import barcode_widget.dart
import 'package:barcode_widget/barcode_widget.dart';
copied to clipboard
Use the widget directly
BarcodeWidget(
barcode: Barcode.code128(),
data: 'Hello Flutter',
);
copied to clipboard
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)),
);
copied to clipboard
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(),
),
],
)
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.