https://github.com/treeder/jsqr_flutter
jsqr wrapper and widget for flutter web
https://github.com/treeder/jsqr_flutter
Last synced: 4 months ago
JSON representation
jsqr wrapper and widget for flutter web
- Host: GitHub
- URL: https://github.com/treeder/jsqr_flutter
- Owner: treeder
- License: other
- Created: 2020-10-22T20:52:55.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-07T21:25:40.000Z (almost 5 years ago)
- Last Synced: 2024-01-22T19:56:39.761Z (over 2 years ago)
- Language: Dart
- Size: 145 KB
- Stars: 13
- Watchers: 5
- Forks: 12
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsqr_flutter
A QR Code Scanner and image capturing library for Flutter. Uses [jsqr](https://github.com/cozmo/jsQR) under the hood for QR codes.
NOTE: Flutter web only.
## Usage
Add this to `web/index.html`:
```html
```
Add this to pubspec:
```
jsqr: ^0.1.1
```
## Scanning for QR codes
Example code:
```dart
var code = await showDialog(
context: context,
builder: (BuildContext context) {
var height = MediaQuery.of(context).size.height;
var width = MediaQuery.of(context).size.width;
return AlertDialog(
insetPadding: EdgeInsets.all(5),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0))),
title: const Text('Scan QR Code'),
content: Container(
// height: height - 20,
width: width - 6,
child: Scanner()),
);
});
```
The `code` var will contain the data contained in the QR code.
See [/example](/example) for full example and usage.
## Image Capture
You can also capture an image too by passing in `clickToCapture: true`, see [/example](/example) for how to use it.