{"id":22726447,"url":"https://github.com/mono0926/barcode_scan2","last_synced_at":"2025-05-16T12:02:22.029Z","repository":{"id":40333509,"uuid":"359643607","full_name":"mono0926/barcode_scan2","owner":"mono0926","description":"[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.","archived":false,"fork":false,"pushed_at":"2025-04-04T06:17:26.000Z","size":449,"stargazers_count":92,"open_issues_count":50,"forks_count":83,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T08:38:29.931Z","etag":null,"topics":["barcode","barcode-reader","barcode-scanner","qrcode","qrcode-reader","qrcode-scanner","reader","scan","scanner"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/barcode_scan2","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mono0926.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":["mono0926"]}},"created_at":"2021-04-20T01:11:44.000Z","updated_at":"2025-04-04T06:16:47.000Z","dependencies_parsed_at":"2024-01-16T10:37:40.176Z","dependency_job_id":"99682e96-957f-4bee-87e5-73a8c57ab152","html_url":"https://github.com/mono0926/barcode_scan2","commit_stats":{"total_commits":166,"total_committers":38,"mean_commits":4.368421052631579,"dds":0.6566265060240963,"last_synced_commit":"3486b6e19a8bbda00cab8f7c5a71fcfc102821e1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mono0926%2Fbarcode_scan2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mono0926%2Fbarcode_scan2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mono0926%2Fbarcode_scan2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mono0926%2Fbarcode_scan2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mono0926","download_url":"https://codeload.github.com/mono0926/barcode_scan2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527074,"owners_count":22085918,"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","barcode-reader","barcode-scanner","qrcode","qrcode-reader","qrcode-scanner","reader","scan","scanner"],"created_at":"2024-12-10T16:17:21.622Z","updated_at":"2025-05-16T12:02:21.953Z","avatar_url":"https://github.com/mono0926.png","language":"Dart","funding_links":["https://github.com/sponsors/mono0926"],"categories":[],"sub_categories":[],"readme":"[![GitHub license](https://img.shields.io/github/license/mono0926/barcode_scan2.svg)](https://github.com/mono0926/barcode_scan2/blob/master/LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/mono0926/barcode_scan2)](https://github.com/mono0926/barcode_scan2/stargazers)\n[![Pub](https://img.shields.io/pub/v/barcode_scan2.svg)](https://pub.dartlang.org/packages/barcode_scan2)\n[![GitHub forks](https://img.shields.io/github/forks/mono0926/barcode_scan2)](https://github.com/mono0926/barcode_scan2/network)\n\n## Reborned🎉\n\nOriginal [barcode_scan](https://pub.dev/packages/barcode_scan) was discontinued, so [barcode_scan2](https://pub.dev/packages/barcode_scan2) was borned with sound null safety support🎉\n\n# barcode_scan2\n\nA flutter plugin for scanning 2D barcodes and QR codes.\n\nThis provides a simple wrapper for two commonly used iOS and Android libraries:\n\n- iOS: https://github.com/mikebuss/MTBBarcodeScanner\n- Android: https://github.com/dm77/barcodescanner\n\n### Features\n\n- [x] Scan 2D barcodes\n- [x] Scan QR codes\n- [x] Control the flash while scanning\n- [x] Permission handling\n\n## Getting Started\n\n### Android\n\nFor Android, you must do the following before you can use the plugin:\n\n* Add the camera permission to your AndroidManifest.xml\n\n     `\u003cuses-permission android:name=\"android.permission.CAMERA\" /\u003e`\n\n* This plugin is written in Kotlin. Therefore, you need to add Kotlin support to your project. See [installing the Kotlin plugin](https://kotlinlang.org/docs/tutorials/kotlin-android.html#installing-the-kotlin-plugin).\n\nEdit your project-level build.gradle file to look like this:\n\n```groovy\nbuildscript {\n    ext.kotlin_version = '1.3.61'\n    // ...\n    dependencies {\n        // ...\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version\"\n    }\n}\n// ...\n```\n\nEdit your app-level build.gradle file to look like this:\n\n```groovy\napply plugin: 'kotlin-android'\n// ...\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"\n    // ...\n}\n```\n\nNow you can depend on the barcode_scan plugin in your pubspec.yaml file:\n\n```yaml\ndependencies:\n    # ...\n    barcode_scan2: any\n```\n\nClick \"Packages get\" in Android Studio or run `flutter packages get` in your project folder.\n\n### iOS\n\nTo use on iOS, you must add the the camera usage description to your Info.plist\n\n```xml\n\u003cdict\u003e\n    \u003c!-- ... --\u003e\n    \u003ckey\u003eNSCameraUsageDescription\u003c/key\u003e\n    \u003cstring\u003eCamera permission is required for barcode scanning.\u003c/string\u003e\n    \u003c!-- ... --\u003e\n\u003c/dict\u003e\n```\n\n\n## Usage\n\n```dart\nimport 'package:barcode_scan2/barcode_scan2.dart';\n\nvoid main() async {\n  var result = await BarcodeScanner.scan();\n\n  print(result.type); // The result type (barcode, cancelled, failed)\n  print(result.rawContent); // The barcode content\n  print(result.format); // The barcode format (as enum)\n  print(result.formatNote); // If a unknown format was scanned this field contains a note\n}\n```\n\n\n## Advanced usage\nYou can pass options to the scan method:\n\n```dart\nimport 'package:barcode_scan2/barcode_scan2.dart';\n\nvoid main() async {\n\n  var options = ScanOptions(\n    // set the options\n  );\n\n  var result = await BarcodeScanner.scan(options: options);\n\n  // ...\n}\n```\n\n### Supported options\n| Option                     | Type              | Description                                                                               | Supported by  |\n|----------------------------|-------------------|-------------------------------------------------------------------------------------------|---------------|\n| `strings.cancel`           | `String`          | The cancel button text on iOS                                                             | iOS only      |\n| `strings.flash_on`         | `String`          | The flash on button text                                                                  | iOS + Android |\n| `strings.flash_off`        | `String`          | The flash off button text                                                                 | iOS + Android |\n| `restrictFormat`           | `BarcodeFormat[]` | Restrict the formats which are recognized                                                 | iOS + Android |\n| `useCamera`                | `int`             | The index of the camera which is used for scanning (See `BarcodeScanner.numberOfCameras`) | iOS + Android |\n| `autoEnableFlash`          | `bool`            | Enable the flash when start scanning                                                      | iOS + Android |\n| `android.aspectTolerance`  | `double`          | Enable auto focus on Android                                                              | Android only  |\n| `android.useAutoFocus`     | `bool`            | Set aspect ratio tolerance level used in calculating the optimal Camera preview size      | Android only  |\n| `android.appBarTitle`      | `String`          | Sets the text of the app bar                                                              | Android only  |\n\n## Development setup\n\n###  Setup protobuf\n\nMac:\n\n```bash\n$ brew install protobuf\n$ brew install swift-protobuf\n```\n\nWindows / Linux: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation\n\n\nActivate the protobuf dart plugin:\n\n```bash\n$ flutter pub global activate protoc_plugin\n```\n\nInstall the`Protobuf Support` plugin for IDEA / Android Studio or `vscode-proto3` for VS Code\n\nIf you changed the protos.proto you've to execute the ./generate_proto.sh to update the dart / swift sources\n\n## Common problems\n### Android \"Could not find org.jetbrains.kotlin:kotlin-stdlib-jre...\"\nChange `org.jetbrains.kotlin:kotlin-stdlib-jre` to `org.jetbrains.kotlin:kotlin-stdlib-jdk`\n([StackOverflow](https://stackoverflow.com/a/53358817))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmono0926%2Fbarcode_scan2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmono0926%2Fbarcode_scan2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmono0926%2Fbarcode_scan2/lists"}