ms_ean_db 0.2.0 copy "ms_ean_db: ^0.2.0" to clipboard
ms_ean_db: ^0.2.0 copied to clipboard

A Dart package to access the EAN database API for product information.

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.

1
likes
140
points
24
downloads

Publisher

verified publishermarcussoftware.info

Weekly Downloads

A Dart package to access the EAN database API for product information.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http

More

Packages that depend on ms_ean_db