Ankit Shukla
Ankit Shukla

Reputation: 751

How to generate barcode in flutter?

I want to generate barcode in flutter but I only found barcode scanner packages like barcode_scan but I want something like zxing library (native in Android) for flutter that also generates Barcode in multiple formats like EAN, Code128 etc. Although my requirement is EAN.

Upvotes: 5

Views: 8522

Answers (3)

sinoj
sinoj

Reputation: 1

you can use "SfBarcodeGenerator" in flutter

example

Widget build(BuildContext context) {
    return MaterialApp(`enter code here`
        home: Scaffold(
        body: Center(
        child: Container(
            height: 200,
            child: SfBarcodeGenerator(
                value: 'www.syncfusion.com',
                symbology: QRCode(),
            ),
        ))),
    );
}

Upvotes: 0

colin
colin

Reputation: 301

I've already implemented a Flutter library did just what you want.

Please check here barcode_flutter EAN8 and EAN13 are both supported.

Screenshot

Upvotes: 6

raju-bitter
raju-bitter

Reputation: 8996

barcode_scan uses the zxing library for the Android plugin, so you could easily extend that plugin to support the APIs for barcode generation. For the iOS version of the plugin, AVMetadataMachineReadableCodeObject is used instead of zxing, since the iOS port of xzing has been discontinued. Flutter supports iOS 8.0+, and iOS 8.0 introduced APIs for generating barcodes as part of the Core Image API. The supported formats are:

  • square QR code
  • Aztec code symbol
  • PDF 417 symbol
  • Data Matrix code symbol

If the barcode you are looking for in this list, it will be easy to fork the barcode_scan package to add the generating functionality for your app.

Upvotes: 2

Related Questions