{"id":17128692,"url":"https://github.com/xvrh/zxing-dart","last_synced_at":"2025-07-14T01:09:52.541Z","repository":{"id":41102721,"uuid":"339378556","full_name":"xvrh/zxing-dart","owner":"xvrh","description":"This package is a pure Dart port of the ZXing (\"zebra crossing\") Java library.","archived":false,"fork":false,"pushed_at":"2024-04-03T07:58:32.000Z","size":128856,"stargazers_count":28,"open_issues_count":8,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T17:50:06.183Z","etag":null,"topics":["barcode","dart","dartlang","zxing"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xvrh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-16T11:36:41.000Z","updated_at":"2025-03-09T19:44:11.000Z","dependencies_parsed_at":"2024-02-22T17:59:04.028Z","dependency_job_id":"33ed0370-f2a2-4c78-b3f6-33d30fffadbb","html_url":"https://github.com/xvrh/zxing-dart","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.125,"last_synced_commit":"87ec00334221008aa3dbf5486315bf7a24948450"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvrh%2Fzxing-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvrh%2Fzxing-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvrh%2Fzxing-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xvrh%2Fzxing-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xvrh","download_url":"https://codeload.github.com/xvrh/zxing-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670515,"owners_count":21142896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["barcode","dart","dartlang","zxing"],"created_at":"2024-10-14T19:07:44.027Z","updated_at":"2025-04-13T05:34:54.254Z","avatar_url":"https://github.com/xvrh.png","language":"Dart","funding_links":["https://www.buymeacoffee.com/xvrh"],"categories":[],"sub_categories":[],"readme":"# zxing-dart\n\nZXing (\"zebra crossing\") is an open-source, multi-format 1D/2D barcode image processing library.  \nThis package is a pure Dart port of the original Java library.\n\nFor now, it only supports **QR-Code** (encoding and decoding). New format can easily be added if this port proves useful.\n\n[![pub package](https://img.shields.io/pub/v/zxing2.svg)](https://pub.dartlang.org/packages/zxing2)\n[![Build Status](https://github.com/xvrh/zxing-dart/workflows/Build/badge.svg?branch=master)](https://github.com/xvrh/zxing-dart)\n[![codecov](https://codecov.io/gh/xvrh/zxing-dart/graph/badge.svg?token=UGGAJMNLBC)](https://codecov.io/gh/xvrh/zxing-dart)\n\n\u003ca href=\"https://www.buymeacoffee.com/xvrh\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"60\" width=\"217\"\u003e\u003c/a\u003e\n\n## Getting started\n\n### QR Code\n\n#### Decoding\n\nThe `QRCodeReader` class takes a list of bytes and returns the decoded barcode.\n```dart\nimport 'dart:io';\nimport 'package:image/image.dart' as img;\nimport 'package:zxing2/qrcode.dart';\n\nvoid main() {\n  var image = img.decodePng(File('tool/example.png').readAsBytesSync())!;\n\n  LuminanceSource source = RGBLuminanceSource(\n      image.width,\n      image.height,\n      image\n          .convert(numChannels: 4)\n          .getBytes(order: img.ChannelOrder.abgr)\n          .buffer\n          .asInt32List());\n  var bitmap = BinaryBitmap(GlobalHistogramBinarizer(source));\n\n  var reader = QRCodeReader();\n  var result = reader.decode(bitmap);\n  print(result.text);\n}\n```\n\n#### Encoding\n\nThe `QRCodeReader` class takes a list of bytes and returns the decoded barcode.\n```dart\nimport 'dart:io';\nimport 'package:image/image.dart' as img;\nimport 'package:zxing2/qrcode.dart';\n\nvoid main() {\n  var qrcode = Encoder.encode('ABCDEF', ErrorCorrectionLevel.h);\n  var matrix = qrcode.matrix!;\n  var scale = 4;\n\n  var image = img.Image(\n      width: matrix.width * scale,\n      height: matrix.height * scale,\n      numChannels: 4);\n  for (var x = 0; x \u003c matrix.width; x++) {\n    for (var y = 0; y \u003c matrix.height; y++) {\n      if (matrix.get(x, y) == 1) {\n        img.fillRect(image,\n            x1: x * scale,\n            y1: y * scale,\n            x2: x * scale + scale,\n            y2: y * scale + scale,\n            color: img.ColorRgba8(0, 0, 0, 0xFF));\n      }\n    }\n  }\n  var pngBytes = img.encodePng(image);\n  File('tool/examples/encoded.png').writeAsBytes(pngBytes);\n}\n```\n\n## Flutter\nThe `example` folder contains a full example that uses the official camera plugin connected to this\npackage to decode barcode from the bytes stream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvrh%2Fzxing-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxvrh%2Fzxing-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxvrh%2Fzxing-dart/lists"}