Pub GitHub stars Buy Me A Coffee donate button

A simple client of EAN-DB API, a database of EAN codes with more than 64 M barcodes.

Features

  • Search for EAN codes

Getting started

Create an account at EAN-DB to get your API token.

You can find your API token in your account settings after logging here.

Usage

To use this package, add ms_ean_db as a dependency in your pubspec.yaml file.

flutter pub add ms_ean_db

Then, import the package in your Dart code:

import 'package:ms_ean_db/ms_ean_db.dart';

So you can use the EanDb class to interact

void main() async {
  final eanDb = EanDb(token: 'YOUR_API_TOKEN');
  final accountResponse = await eanDb.getAccount();
  print('Account: ${accountResponse.data.primaryEmail}'); // Account: your_nice_email@host.com
  print('Balance: ${accountResponse.data.balance}'); // Balance: 123
  final productResponse = await eanDb.barcodeLookup('7896051135425');
  print(
    'Product: ${productResponse.data?.titles.get('pt')}',
  ); // Output: Product: Manteiga de Primeira Qualidade com Sal
}

Thanks

I would like to thank EAN-DB for providing this API and allowing us to use it in our projects.

I hope this package helps you to easily integrate EAN code search functionality into your Flutter applications. Consider supporting the project by buying me a coffee if you find it useful.