check1e / jsqr_flutter

jsqr wrapper and widget for flutter web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsqr_flutter

A QR Code Scanner and image capturing library for Flutter. Uses jsqr under the hood for QR codes.

NOTE: Flutter web only.

Usage

Add this to web/index.html:

<script src="https://cdn.jsdelivr.net/npm/jsqr@1.3.1/dist/jsQR.min.js"></script>

Scaning for QR codes

Example code:

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 for full example and usage.

Image Capture

You can also capture an image too by passing in clickToCapture: true, see /example for how to use it.

About

jsqr wrapper and widget for flutter web

License:Other


Languages

Language:Dart 90.8%Language:HTML 6.1%Language:Swift 1.5%Language:Makefile 1.1%Language:Kotlin 0.4%Language:Objective-C 0.1%